Tôi đang cố gắng triển khai thu phí thu nhỏ bằng thao tác vuốt để làm mới và recyclerview. Khi tôi đang cố gắng cuộn (khi recyclerview chỉ có một mục) thanh công cụ sụp đổ, nhưng khi tôi đang cố gắng cuộn xuống để hiển thị thanh công cụ, điều đó là không thể vì vuốt xuống khiến vuốt vuốt làm mới. Khi recyclerview có nhiều mục nó hoạt động hoàn hảo.Thanh công cụ không hiển thị bằng thao tác vuốt để làm mới
Ai đó có thể giúp tôi không?
<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" />
có thể trùng lặp của [Android: CollapsingToolbarLayout và SwipeRefreshLayout gặp khó khăn] (http://stackoverflow.com/questions/30779667/android-collapsingtoolbarlayout-and-swiperefreshlayout-get-stuck) –
[Điều này hiện đã được khắc phục trong Thư viện hỗ trợ v23.1.1 mà không có bất kỳ giải pháp nào] (http://stackoverflow.com/a/33776549/383414) –