Android: trying to understand android:layout_weight

前端 未结 2 1448
名媛妹妹
名媛妹妹 2020-12-13 10:51

I\'m trying to divide a page in three parts. I\'d like to do it in percentage values, however that is not supported by Android. Instead I have to use android:layout_we

2条回答
  •  失恋的感觉
    2020-12-13 10:58

    Is there a way to get a percentage value (0..100%) out of android:layout_weight?

    Sure. Make them add up to 100.

    For your "percentage value", you want the android:layout_height of the individual items within the LinearLayout to be 0px.

提交回复
热议问题