<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="进攻" android:layout_centerHorizontal="true" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="撤退" android:layout_centerHorizontal="true" android:layout_alignParentBottom="true" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="左钩拳" android:layout_centerVertical="true" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="右钩拳" android:layout_centerVertical="true" android:layout_alignParentRight="true" /> <Button android:text="必杀技" android:layout_centerInParent="true" android:id="@+id/bisha" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:layout_toLeftOf="@id/bisha" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="左" android:layout_alignTop="@id/bisha" /> <Button android:layout_above="@id/bisha" android:text="上" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" /> <Button android:layout_below="@id/bisha" android:text="下" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" /> <Button android:layout_toRightOf="@id/bisha" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="右" android:layout_alignTop="@id/bisha" /> </RelativeLayout>
安卓入门.相对布局练习
猜你喜欢
转载自8850702.iteye.com/blog/2277635
今日推荐
周排行