Android中RelativeLayout各個屬性的含義

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

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

android:layout_alignLeft="@id/xxx"  --將控件的左邊緣和給定ID控件的左邊緣對齊
android:layout_alignTop="@id/xxx"  --將控件的上邊緣和給定ID控件的上邊緣對齊
android:layout_alignRight="@id/xxx"  --將控件的右邊緣和給定ID控件的右邊緣對齊
android:layout_alignBottom="@id/xxx"  --將控件的底邊緣和給定ID控件的底邊緣對齊
android:layout_alignParentLeft="true"  --將控件的左邊緣和父控件的左邊緣對齊
android:layout_alignParentTop="true"  --將控件的上邊緣和父控件的上邊緣對齊
android:layout_alignParentRight="true"  --將控件的右邊緣和父控件的右邊緣對齊
android:layout_alignParentBottom="true" --將控件的底邊緣和父控件的底邊緣對齊
android:layout_centerInParent="true"  --將控件置於父控件的中心位置
android:layout_centerHorizontal="true"  --將控件置於水平方向的中心位置
android:layout_centerVertical="true"  --將控件置於垂直方向的中心位置


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章