常用屬性:
排列對齊:
①設定元件的排列方式: android:orientation="" vertical(豎直,預設)或者horizontal(水準)
②設定元件的對齊方式: android:layout_gravity="" center,left,right,buttom啊,這些,如果想同時用兩種的話:eg: buttom|left
設定布局為幾行幾列:
①設定有多少行:android:rowCount="4" //設定網格布局有4行
②設定有多少列:android:columnCount="4" //設定網格布局有4列
設定某個元件位于幾行幾列
注:都是從0開始算的哦!
①元件在第幾行:android:layout_row = "1" //設定元件位于第二行
②元件在第幾列:android:layout_column = "2" //設定該元件位于第三列
設定某個元件橫跨幾行幾列:
①橫跨幾行:android:layout_rowSpan = "2" //縱向橫跨2行
②橫跨幾列:android:layout_columnSpan = "3" //橫向橫跨2列
執行個體講解請參考連結:
https://blog.csdn.net/jianghuiquan/article/details/8299973