【发布时间】:2016-12-03 07:53:03
【问题描述】:
我目前在我的应用程序中使用SwipeRefreshLayout 和RecyclerView。一切正常。
我不确定的是,当第一次在屏幕上加载数据时,我应该使用SwipeRefreshLayout 的循环加载指示器,如下所示。
swipeRefreshLayout.post(new Runnable() {
@Override public void run() {
swipeRefreshLayout.setRefreshing(true);
}
});
或者我应该使用特定的ProgressBar 来表示循环加载指示器,如下所示。
private ProgressBar spinner;
spinner = (ProgressBar) findViewById(R.id.progressBar1);
spinner.setVisibility(View.VISIBLE);
根据 Google Material Design Guidelines,哪种方法更正确,因为它们在 SwipeRefreshLayout 和 ProgressBar 指标之间存在重大视觉差异。 (我已经google了很多,但没有找到正确的答案。)
【问题讨论】:
标签: android material-design android-progressbar swiperefreshlayout