What is android:weightSum in android, and how does it work?

前端 未结 9 883
梦毁少年i
梦毁少年i 2020-11-22 04:02

I want to know: What is android:weightSum and layout weight, and how do they work?

9条回答
  •  一整个雨季
    2020-11-22 04:15

    From developer documentation

    This can be used for instance to give a single child 50% of the total available space by giving it a layout_weight of 0.5 and setting the weightSum to 1.0.

    Addition to @Shubhayu answer

    rest 3/5 can be used for other child layouts which really doesn't need any specific portion of containing layout.

    this is potential use of android:weightSum property.

提交回复
热议问题