2010-12-04 113 views
0

我正在构建一个Android应用程序,其中有一个GridView中的项目列表,我希望用户选择它们中的任何一个。我不想使用无线电组/收音机,但是一个图标和它旁边的项目名称。需要Android布局建议

一旦用户选择了一些东西,我有三个按钮在底部,后面,取消和设置为默认值。

问题是安排这个东西,以便它在横向模式以及纵向模式下显示正常。

有人可以建议一个良好的布局骨架?

下面是Android布局文件内容



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/widget30"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<GridView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/GridView01"
android:layout_width="fill_parent"
android:layout_height="370dip"
android:numColumns="auto_fit"
android:stretchMode="columnWidth"
android:layout_alignParentTop="true"
android:gravity="center">
</GridView>

<Button
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Back "
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="@+id/GridView01"

>
</Button>

<Button
android:id="@+id/setDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Set as Default "
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@+id/cancel"
android:layout_below="@+id/GridView01"
>
</Button>
<Button
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Cancel "
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/GridView01"
>
</Button>
</RelativeLayout>

回答

0

使用相对布局,Click Here知道如何使用相对布局。

+0

你好Sankar,我用绝对布局。请求您通过布局本身更多地帮助我。 – Rupin 2010-12-09 15:10:52