Android 的 Relative Layout 常量

  • android:layout_above 将该控件的底部置于给定ID的控件之上                    --Rule that aligns a child's bottom edge with another child's top edge.
  • android:layout_below 将该控件的顶部置于给定ID的控件之下                    --Rule that aligns a child's top edge with another child's bottom edge.
  • android:layout_toLeftOf 将该控件的右边缘和给定ID的控件的左边缘对齐            --Rule that aligns a child's right edge with another child's left edge.
  • android:layout_toRightOf 将该控件的左边缘和给定ID的控件的右边缘对齐            --Rule that aligns a child's left edge with another child's right edge.

 

  • android:layout_alignBaseline 该控件的baseline和给定ID的控件的baseline对齐        --Rule that aligns a child's baseline with another child's baseline.
  • android:layout_alignBottom 将该控件的底部边缘与给定ID控件的底部边缘            --Rule that aligns a child's bottom edge with another child's bottom edge.
  • android:layout_alignLeft 将该控件的左边缘与给定ID控件的左边缘对齐            --Rule that aligns a child's left edge with another child's left edge.
  • android:layout_alignRight 将该控件的右边缘与给定ID控件的右边缘对齐            --Rule that aligns a child's right edge with another child's right edge.
  • android:layout_alignTop 将给定控件的顶部边缘与给定ID控件的顶部对齐            --Rule that aligns a child's top edge with another child's top edge.



  • android:layout_alignParentBottom 如果该值为true,则将该控件的底部和父控件的底部对齐    --Rule that aligns the child's bottom edge with its RelativeLayout parent's bottom edge.
  • android:layout_alignParentLeft 如果该值为true,则将该控件的左边与父控件的左边对齐    --Rule that aligns the child's left edge with its RelativeLayout parent's left edge.
  • android:layout_alignParentRight 如果该值为true,则将该控件的右边与父控件的右边对齐    --Rule that aligns the child's right edge with its RelativeLayout parent's right edge.
  • android:layout_alignParentTop 如果该值为true,则将空间的顶部与父控件的顶部对齐        --Rule that aligns the child's top edge with its RelativeLayout parent's top edge.

 

  • android:layout_centerHorizontal 如果值为true,该控件将被置于水平方向的中央        --Rule that centers the child horizontally with respect to the bounds of its RelativeLayout parent.
  • android:layout_centerInParent 如果值为true,该控件将被置于父控件水平方向和垂直方向的中央--Rule that centers the child with respect to the bounds of its RelativeLayout parent.
  • android:layout_centerVertical 如果值为true,该控件将被置于垂直方向的中央        --Rule that centers the child vertically with respect to the bounds of its RelativeLayout parent.
posted @ 2014-12-05 13:50  wonkju  阅读(257)  评论(0编辑  收藏  举报