RelativeLayout各個屬性

下面是RelativeLayout各個屬性 

  1. android:layout_above="@id/xxx"  --將控件置於給定ID控件之上

  2. android:layout_below="@id/xxx"  --將控件置於給定ID控件之下

  3. android:layout_toLeftOf="@id/xxx"  --將控件的右邊緣和給定ID控件的左邊緣對齊

  4. android:layout_toRightOf="@id/xxx"  --將控件的左邊緣和給定ID控件的右邊緣對齊

  5. android:layout_alignLeft="@id/xxx"  --將控件的左邊緣和給定ID控件的左邊緣對齊

  6. android:layout_alignTop="@id/xxx"  --將控件的上邊緣和給定ID控件的上邊緣對齊

  7. android:layout_alignRight="@id/xxx"  --將控件的右邊緣和給定ID控件的右邊緣對齊

  8. android:layout_alignBottom="@id/xxx"  --將控件的底邊緣和給定ID控件的底邊緣對齊

  9. android:layout_alignParentLeft="true"  --將控件的左邊緣和父控件的左邊緣對齊

  10. android:layout_alignParentTop="true"  --將控件的上邊緣和父控件的上邊緣對齊

  11. android:layout_alignParentRight="true"  --將控件的右邊緣和父控件的右邊緣對齊

  12. android:layout_alignParentBottom="true" --將控件的底邊緣和父控件的底邊緣對齊

  13. android:layout_centerInParent="true"  --將控件置於父控件的中心位置

  14. android:layout_centerHorizontal="true"  --將控件置於水平方向的中心位置

  15. android:layout_centerVertical="true"  --將控件置於垂直方向的中心位置

發佈了27 篇原創文章 · 獲贊 46 · 訪問量 14萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章