我想创建一个适合按钮和ImageView之间的ListView。 我有一个RelativeLayout,它的顶部有一个按钮,底部有一个ImageView。 我想要一个ListView之间。这就是我所做的。我如何使一个按钮和ImageView垂直的ListView适合
我在按钮下看到我的listView,但它与底部的ImageView重叠。 那么我怎样才能让ListView上方的ImageView?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/control_panel"
android:layout_width="@dimen/mywidth"
android:layout_height="match_parent"
android:orientation="vertical">
<Button android:id="@+id/button"
android:layout_height="@dimen/button_size"
android:layout_width="@dimen/button_size"
android:scaleType="center"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/btn_shutter" />
<ListView android:id="@+id/image_list"
android:layout_width="@dimen/button_size"
android:layout_height="wrap_content"
android:drawSelectorOnTop="false"
android:layout_above="@+id/image"
android:layout_below="@+id/button"/>
<ImageView
android:id="@+id/image"
android:layout_width="@dimen/mywidth"
android:layout_height="@dimen/image_height"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
这是很难说没有知道你'@ dimen'变量的值。 – MrZander
尝试计算按钮底部和ImageView顶部之间的距离,然后将其设置为运行时的ListView高度。 – Sam