Android RelativeLayout 属性

// 相对于给定ID控件android

android:layout_above 将该控件的底部置于给定ID的控件之上;post

android:layout_below 将该控件的底部置于给定ID的控件之下;blog

android:layout_toLeftOf    将该控件的右边缘与给定ID的控件左边缘对齐;class

android:layout_toRightOf  将该控件的左边缘与给定ID的控件右边缘对齐;layout

 

android:layout_alignBaseline  将该控件的baseline与给定ID的baseline对齐;margin

android:layout_alignTop        将该控件的顶部边缘与给定ID的顶部边缘对齐;移动

android:layout_alignBottom   将该控件的底部边缘与给定ID的底部边缘对齐;di

android:layout_alignLeft        将该控件的左边缘与给定ID的左边缘对齐;垂直居中

android:layout_alignRight      将该控件的右边缘与给定ID的右边缘对齐;居中

// 相对于父组件

android:layout_alignParentTop      若是为true,将该控件的顶部与其父控件的顶部对齐;

android:layout_alignParentBottom 若是为true,将该控件的底部与其父控件的底部对齐;

android:layout_alignParentLeft      若是为true,将该控件的左部与其父控件的左部对齐;

android:layout_alignParentRight    若是为true,将该控件的右部与其父控件的右部对齐;

// 居中

android:layout_centerHorizontal 若是为true,将该控件的置于水平居中;

android:layout_centerVertical     若是为true,将该控件的置于垂直居中;

android:layout_centerInParent   若是为true,将该控件的置于父控件的中央;

// 指定移动像素

android:layout_marginTop      上偏移的值;

android:layout_marginBottom 下偏移的值;

android:layout_marginLeft   左偏移的值;

android:layout_marginRight   右偏移的值;

 

example:

android:layout_below = "@id/***"

android:layout_alignBaseline = "@id/***"

android:layout_alignParentTop = true

android:layout_marginLeft = “10px”