我有LinearLayout
組件,其中包含ListView
和ImageView
。如何使ListView和ImageView可滾動到LinearLayout中?
根據文檔佈局區域應該可滾動元素的高度大於LinearLayout的區域。
但滾動不可用。
我只能在listview包含很多元素時才能滾動。但在這種情況下,ImageView
組件根本不可見。
使用ScrollView
是不允許的,因爲ListView
有他自己的滾動元素。
請問請問,我該怎麼辦?
這裏是我的xml文件的一部分:
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/top_header"
android:layout_above="@id/bottom_menu"
android:layout_weight="1"
android:id="@+id/sub_content_view">
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/eventsListView"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="260dp"
android:id="@+id/empty_area"
android:adjustViewBounds="true"
android:background="@drawable/empty_area"
android:contentDescription="@string/contentDescription"/>
</LinearLayout>