我正在为安卓游戏设计一个 GUI。到目前为止,我设计了这个
这是我的代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:orientation="vertical"
tools:context=".Start"
tools:ignore="MergeRootFrame" >
<GridLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:columnCount="1"
android:padding="10dip"
android:rowCount="3" >
<Button
android:id="@+id/nG"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dip"
android:layout_marginTop="40dip"
android:background="@drawable/red"
android:onClick="nGame"
android:text="New" />
<Button
android:id="@+id/hS"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dip"
android:layout_marginTop="20dip"
android:background="@drawable/green"
android:onClick="hScore"
android:text="High Scores" />
<Button
android:id="@+id/a"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dip"
android:layout_marginTop="20dip"
android:background="@drawable/blue"
android:onClick="about"
android:text="About" />
</GridLayout>
</LinearLayout>
但我想这样看我的用户界面
我尝试使用 android:gravity 来做到这一点。但我无法找到解决方案。