首页 > 如何得到fragment的高度?

如何得到fragment的高度?

如何得到fragment的高度?


fragment.getView().getMeasuredHeight()


Fragment依附在View容器中,得到View的高度不就是是Fragment高度了?


fragment没有提供像Activity类似的onWindowFocusChanged方法,但可以使用ViewTreeObserver来获取。


transaction.replace(frameLayout,fragment)
得到frameLayout的高度就可以了

【热门文章】
【热门文章】