android - 如何得到fragment的高度?
迷茫
迷茫 2017-04-17 17:28:23
0
4
676

如何得到fragment的高度?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(4)
刘奇

Fragment is attached to the View container. Isn’t the height of the View the same as the height of the Fragment?

PHPzhong

fragment没有提供像Activity类似的onWindowFocusChanged方法,但可以使用ViewTreeObserver Come and get it.

阿神

transaction.replace(frameLayout, fragment)
Just get the height of frameLayout

阿神

fragment.getView().getMeasuredHeight()

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template