Ich versuche kollabierende Tollbar mit Swipe zu aktualisieren und Recyclerview zu implementieren. Wenn ich versuche, einen Bildlauf durchzuführen (wenn Recyclerview nur ein Element enthält), verkleinere die Symbolleiste , aber wenn ich versuche, nach unten zur Symbolleiste zu scrollen, ist das unmöglich, weil der Finger nach unten wischt, um zu aktualisieren. Wenn RecyclerView mehr Artikel hat, funktioniert es perfekt.Toolbar nicht mit Swipe zum Aktualisieren angezeigt
Kann mir jemand helfen?
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="1dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="1dp"
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/activity_main_swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.v7.widget.RecyclerView
android:id="@+id/cities_list"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
android:elevation="1dp"
android:onClick="addCity"
android:src="@drawable/ic_plus_white_36dp"
app:borderWidth="0dp" />
Mögliches Duplikat [Android: CollapsingToolbarLayout und SwipeRefreshLayout stecken] (http://stackoverflow.com/questions/30779667/android-collapsingtoolbarlayout-and-swiperefreshlayout-get-stecken) –
[Dies wurde jetzt in der Support-Bibliothek v23.1.1 ohne Umgehungslösungen behoben] (http://stackoverflow.com/a/33776549/383414) –