【发布时间】:2016-02-17 12:06:21
【问题描述】:
我有一个导航抽屉,里面还有 2 个片段。一个片段有一个列表视图,但列表视图没有滚动。我正在获取数据,但唯一的问题是列表视图不允许向下滚动。
activity_main
<android.support.design.widget.CoordinatorLayout
android:id="@+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white" />
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:id="@+id/Shitstuff"
app:itemTextColor="@color/colorPrimary"
app:menu="@menu/drawermenu"
android:layout_marginTop="-24dp">
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
列表视图
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FragmentA">
<ListView
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/listView"
android:divider="#020202"
android:dividerHeight="0.5dp" />
</FrameLayout>
【问题讨论】:
-
请找到图片链接:postimg.org/image/6gvifajnd
-
我只得到前 7 条记录.. 但 url 有大约 118 个 jsonArrays..
-
使用嵌套滚动和分页或只使用嵌套滚动,即使显示所有数据,您也可以向下滚动
-
我在 ListView 中添加了 android:nestedScrollingEnabled="true" 但仍然无法向下滚动..
-
但还有一件事嵌套滚动仅适用于棒棒糖或更高版本
标签: android listview android-fragments android-coordinatorlayout