tôi bắt đầu sử dụng CoordinatorLayout mới và tôi chạy vào vấn đề này:cuộn xuống trigger làm mới thay vì để lộ thanh công cụ
Như bạn có thể nhìn thấy khi tôi cố gắng để di chuyển xuống khi thanh công cụ là một phần có thể nhìn thấy và recylcerview ở vị trí trên cùng nó kích hoạt sự kiện làm mới thay vì kéo thanh công cụ xuống. Người dùng phải di chuyển lên trên xuống một lần nữa để tiết lộ nó.
Layout XML trông giống như sau: activity_main.xml:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/customActionBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white"
app:headerLayout="@layout/navigation_drawer_header"
app:menu="@menu/navigation_items" />
</android.support.v4.widget.DrawerLayout>
fragment_main.xml:
<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">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:padding="8dp"
android:scrollbars="none" />
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>
Ther SwipeRefreshLayout là trong một FrameLayout bởi vì có nhiều yếu tố trong đoạn trong tôi ứng dụng.
Mọi trợ giúp sẽ được đánh giá cao.
có thể trùng lặp của [Android: CollapsingToolbarLayout và SwipeRefreshLayout gặp khó khăn] (http://stackoverflow.com/questions/30779667/android -ollapsingtoolbarlayout-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) –
@RichardLeMesurier Tôi không nghĩ rằng nó được giải quyết hoàn toàn. Tôi đang đối mặt với những thứ tương tự bằng cách sử dụng phiên bản 23.3. – zgulser