如何得到fragment的高度?
fragment.getView().getMeasuredHeight()
Fragment依附在View容器中,得到View的高度不就是是Fragment高度了?
fragment
没有提供像Activity
类似的onWindowFocusChanged
方法,但可以使用ViewTreeObserver
来获取。
transaction.replace(frameLayout,fragment)
得到frameLayout的高度就可以了
如何得到fragment的高度?
fragment.getView().getMeasuredHeight()
Fragment依附在View容器中,得到View的高度不就是是Fragment高度了?
fragment
没有提供像Activity
类似的onWindowFocusChanged
方法,但可以使用ViewTreeObserver
来获取。
transaction.replace(frameLayout,fragment)
得到frameLayout的高度就可以了