What does android:layout_weight mean?

前端 未结 13 1241
遇见更好的自我
遇见更好的自我 2020-11-21 06:14

I don\'t understand how to use this attribute. Can anyone tell me more about it?

13条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-21 06:45

    As the name suggests, Layout weight specifies what amount or percentage of space a particular field or widget should occupy the screen space.
    If we specify weight in horizontal orientation, then we must specify layout_width = 0px.
    Similarly, If we specify weight in vertical orientation, then we must specify layout_height = 0px.

提交回复
热议问题