Scroll up does not work with SwipeRefreshLayout in Listview

后端 未结 10 1422
失恋的感觉
失恋的感觉 2020-12-01 10:36

I want to implement scroll to refresh functionality with a listView. Also there are other view elements in the same layout file which are displayed if the list is empty. Her

10条回答
  •  自闭症患者
    2020-12-01 10:50

    Make your own implementation of SwipeRefreshLayout and override the canChildScrollUp in this way:

    @Override
    public boolean canChildScrollUp() {
    if (scrollView != null)
        return scrollView.canScrollVertically(-1);
    
    return false;
    }
    

    just replace with any subclass of ScrollView.

提交回复
热议问题