我想要一个类似于
有点内疚,因为我最近刚问了一个关于布局的问题,但我不知道我需要这样做(我也不知道这很难),我研究了 View Layouts 并尝试过使用layout.toRightOf
等。我有左/右箭头,我只需要添加向上和向下按钮
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:game_view="http://schemas.android.com/apk/res/pap.crowslanding"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<FrameLayout
android:id="@+id/flayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/button1"
android:orientation="vertical" >
<pap.crowslanding.GameView
android:id="@+id/game_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
game_view:ballDiam="@dimen/ballDiam"
game_view:cellWidth="@dimen/cellWidth"
game_view:pixelHeight="@dimen/pixelHeight"
game_view:pixelWidth="@dimen/pixelWidth" />
<pap.crowslanding.MazeBall
android:id="@+id/mazeball"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="invisible"
game_view:ballDiam="@dimen/ballDiam"
game_view:cellWidth="@dimen/cellWidth" />
</FrameLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/right" >
</Button>
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/down" />
</LinearLayout>
</RelativeLayout>
所以本质上,只是对如何在同一布局中添加向上和向下按钮的一些见解,以避免布局绘制到我的活动上并重叠