Get height and width of a layout programmatically

前端 未结 16 1417
别那么骄傲
别那么骄傲 2020-11-27 13:55

I have designed an layout in which LinearLayout has 2 children LinearLayout and FrameLayout and in each child I put different views.

16条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 14:56

    I think you are getting Height and Width in OnCreate() method that's why you getting always 0 values because at that time your view still not created.

    Try to get height and width on some button click or else..

提交回复
热议问题