我一直在寻找新材料设计的实现,在RecyclerViews上滑动以刷新ActionBar的加载循环,比如新的Gmail应用程序。我还没有发现类似的东西,只有一些SwipeRefreshLayout+RecyclerView示例。有人知道怎么做吗?
发布于 2014-11-07 14:57:47
您可以使用应用程序支持库中提供的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>希望我能帮忙!
https://stackoverflow.com/questions/26802552
复制相似问题