1. 程式人生 > >[Android] android:layout_weight 屬性的工作原理

[Android] android:layout_weight 屬性的工作原理

屬性 clas nbsp 決定 oid androi 水平 高度 bsp

該屬性告知 LinearLayout 如何安排子組件的布局:

  • 水平方向的 LinearLayout,查看 layou_widthlayout_weight以決定子組件的寬度。
  • 垂直方向的 LinearLayout,查看 layou_heightlayout_weight以決定子組件的高度。

[Android] android:layout_weight 屬性的工作原理