【发布时间】:2012-11-09 12:31:50
【问题描述】:
我正在做一个 android 应用程序,我想将布局分成 3 个部分,如下所示:
但现在按钮在第二个列表视图上方,但在屏幕底部,我不知道为什么。
我不知道是否必须使用 relativeLayout 或 linearLayout 来包含列表视图,并且文本在此内部或 relativelayout/linearLayout 外部,最后一个按钮是什么?
这是我的代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView android:id="@+id/imageSelected"
android:text="@string/imgSelected"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginBottom="3dip"/>
<LinearLayout
android:id="@+id/linearLayoutImagenes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_below="@+id/imageSelected" >
<ListView
android:id="@+id/listaFusionPhotos"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout >
<TextView android:id="@+id/nameSelected"
android:text="@string/namSelected"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_below="@+id/linearLayoutImagenes"
android:layout_marginBottom="3dip"/>
<LinearLayout
android:id="@+id/linearLayoutNombres"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_below="@+id/nameSelected"
>
<ListView
android:id="@+id/listaFusionNombres"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout >
<Button
android:id="@+id/fusion"
android:layout_width="160dip"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayoutNombres"
android:layout_marginTop="3dip"
android:text="Fusionar"
android:onClick="Mostrar_Registrados"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
【问题讨论】:
-
为什么不在
ScrollView中使用相对布局
标签: android listview button scroll