RelativeLayout(相对布局)的使用
以父对象为基准:
<!--相关属性-->
layout_alignParentTop
layout_alignParentBottom
layout_centerInParent
layout_alignParentLeft
layout_alignParentRight
<!--使用样例:(将组件放置到右上)
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
-->
以组件为基准:
<!--相关属性-->
layout_above
layout_below
layout_toLeftOf
layout_toRightOf
<!--使用样例:(将组件放置到btnOne的右下)
android:layout_below="@id/btnOne"
android:layout_alignParentRight="@id/btnOne"
-->
补充:(layout_gravity属性)
<!--取值组合-->
top bottom center_vertical center_horizontal left right end
<!--使用样例:
android:layout_gravity="right|bottom"(将组件放置到右下)
android:layout_gravity="center_horizontal"(让组件水平居中)
-->
297

被折叠的 条评论
为什么被折叠?



