我想有一个类似的布局

我有点内疚,因为我最近刚问了一个关于布局的问题,但我不知道我需要这样做(我也不知道它有这么难),我研究过视图布局,我尝试过使用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>因此,本质上,我只是对如何在相同的布局中添加向上和向下按钮的一些见解,以避免绘制到我的活动上的布局和重叠
发布于 2013-04-20 05:55:52
似乎你所有的按钮图像都有相同的高度,所以为什么不直接使用TableLayout呢?保留左上角和右上角的单元格为空,在其他单元格中放置按钮。
代码(省略变量):
<TableLayout>
<TableRow>
<View />
<Button>...</Button>
<View />
</TableRow>
<TableRow>
<Button>...</Button>
<Button>...</Button>
<Button>...</Button>
</TableRow>
</TableLayout>https://stackoverflow.com/questions/16114063
复制相似问题