【发布时间】:2016-12-21 20:23:09
【问题描述】:
我的应用包含不同的活动,我使用SwipeRefreshLayout 通过滑动 刷新listViews 中的数据。发生这种情况时,屏幕顶部会显示一个刷新图标。
但是,对于其他 2 个不包含列表视图的特定活动,我只想在使用 pullToRefresh.setRefreshing(true); 和 pullToRefresh.setRefreshing(false); 刷新数据时显示刷新图标。我不需要用它来刷卡。
这是它在我的列表视图布局 xml 文件中的外观:
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/ListView"
android:dividerHeight="8dp"
android:divider="#000000"
android:layout_below="@+id/feedLinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
【问题讨论】:
-
那么,问题是什么?何时调用 setRefreshing(true) 和 setRefreshing(false)?
-
不,问题是我可以在没有列表视图的情况下使用这些方法。如果是,如何? @MatiasElorriaga
-
@espa_network Matias 对 ListView 只字未提。
-
@cricket_007 不,但他确实问过问题是什么;)
标签: java android swiperefreshlayout