【问题标题】:SwipeRefreshLayout or ProgressBar at first time data load首次加载数据时 SwipeRefreshLayout 或 ProgressBar
【发布时间】:2016-12-03 07:53:03
【问题描述】:

我目前在我的应用程序中使用SwipeRefreshLayoutRecyclerView。一切正常。

我不确定的是,当第一次在屏幕上加载数据时,我应该使用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,哪种方法更正确,因为它们在 SwipeRefreshLayoutProgressBar 指标之间存在重大视觉差异。 (我已经google了很多,但没有找到正确的答案。)

【问题讨论】:

    标签: android material-design android-progressbar swiperefreshlayout


    【解决方案1】:

    当然,您应该在第一次加载数据时使用进度条。

    SwipeRefreshLayout 仅用于当您在同一屏幕上并想检查是否有新数据可用时使用

    【讨论】:

    • 你的参考资料是什么?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-18
    • 1970-01-01
    • 2018-10-24
    • 1970-01-01
    • 1970-01-01
    • 2017-09-15
    相关资源
    最近更新 更多