Ich habe ein Fragment aus Sichtpager aufgebläht, die die Listview verwendet. Die Listenansicht unterstützt setNestedScrollingEnabled nicht in Pre-Lollipop-Geräten. Also habe ich die Listview innerhalb einer NestedScrollView hinzugefügt, aber beim Scrollen der Liste scrollt sie nicht.ListView scrollt nicht innerhalb von NestedScrollView in Android
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:id="@+id/fragment_item_view"
android:background="@color/white"
android:isScrollContainer="true">
<ProgressBar
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progressBar"
android:layout_centerInParent="true" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:fillViewport="true">
<ListView
android:id="@+id/list_item_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:clipToPadding="false"
android:divider="@color/gray_stroke_color"
android:dividerHeight="0.5dp"
android:paddingBottom="@dimen/padding_64dp" >
</ListView>
</android.support.v4.widget.NestedScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>
Kann mir jemand irgendeine Lösung vorschlagen. Danke im Voraus.
Verwenden Sie RecyclerView anstelle von ListView –
Dies ist die letzte Lösung, die ich kenne. Aber es gibt ein großes Nein. der Listenansicht in meinem Projekt. Sie alle zu verändern, ist zeitaufwendig. Es wird also toll sein, wenn mir jemand bei der Listenansicht helfen kann. –
Sie benötigen scrollView nicht über listView, da listview über einen eigenen Bildlauf verfügt – Beloo