我有一個活動,它承載了幾個片段。此活動佈局還包含頁腳。其中一個片段有一個ListView,它需要可滾動,因爲最後一個項目出現在活動佈局的頁腳後面。問題是我無法使其滾動。我這裏還有我的佈局:在android中的ListView滾動問題
活動:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
layout="@layout/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/fragment_container">
</FrameLayout>
</LinearLayout>
<include
layout="@layout/footer_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<android.support.design.widget.NavigationView
android:id="@+id/navigation_drawer"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#384554"
app:menu="@menu/navigation_drawer_resources"
app:itemTextColor="@android:color/white"
app:itemIconTint="@android:color/white"
app:headerLayout="@layout/navigation_drawer_header"
app:theme="@style/MyNavigationDrawer"/>
</android.support.v4.widget.DrawerLayout>
我的片段:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/fragment_activities_catalogue">
<ImageView
android:layout_width="match_parent"
android:layout_height="70dp"
android:id="@+id/city_picture"
android:src="@drawable/city_header"
android:scaleType="fitStart"/>
<Button
android:layout_width="250dp"
android:layout_height="35dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:background="@drawable/button"
android:textAllCaps="false"
android:textColor="@android:color/white"/>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="5dp"
android:background="#c4c4c4"/>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/listview"
android:layout_marginTop="8dp"
android:scrollbars="vertical"
android:smoothScrollbar="true">
</ListView>
</LinearLayout>