本文介绍了setRefreshing(真)不显示指标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SwipeRefreshLayout,一切都很好,当列表视图有一些孩子的。问题是:当ListView控件没有chileds它不显示setRefreshing(真)调用后,负载指示灯。如何解决呢?

I am using SwipeRefreshLayout and everything is fine, when Listview has some childs. Problem is: when listView has no chileds it does not show load indicator after setRefreshing(true) call. How to fix it?

推荐答案

它实际上显示的ActionBar背后的指示...!

It actually does show the indicator...behind the ActionBar!

我固定的方法是如下:

    Display display = getActivity().getWindowManager().getDefaultDisplay();
    Point size = new Point();
    display.getSize(size);
    int height = size.y;
    getSwipeRefreshLayout().setProgressViewOffset(false, -200, height / 9);

修改

上面不再是正确的答案。正确的答案是如下:

The above is no longer the correct answer. The correct answer is below:

getSwipeRefreshLayout().post(new Runnable() {
    @Override public void run() {
        getSwipeRefreshLayout().setRefreshing(true);
    }
});

这篇关于setRefreshing(真)不显示指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 02:45