簡體   English   中英

向下滑動以刷新Material Design

[英]Swipe down to refresh Material Design

我一直在尋找新材料設計的實施,以便在RecyclerViews上刷新,從ActionBar下載加載圈,就像新的Gmail應用程序一樣。 我還沒有找到類似的東西,只有一些SwipeRefreshLayout + RecyclerView示例。 有誰知道如何做到這一點?

您可以使用appcombat支持庫中提供的SwipeToRefresh視圖:

compile 'com.android.support:appcompat-v7:21.0.0'

以下是與RecyclerView結合使用的方法

<android.support.v4.widget.SwipeRefreshLayout
    android:id="@+id/swipe_refresh_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/list"
        android:layout_width="match_parent"
        android:clipToPadding="false"
        android:layout_height="match_parent"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_horizontal_margin"
        android:paddingBottom="@dimen/activity_vertical_margin" />

</android.support.v4.widget.SwipeRefreshLayout>

希望我能幫忙!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM