SwipeRefreshLayout with scrollView and Layout above

后端 未结 4 515
攒了一身酷
攒了一身酷 2020-12-28 13:39

I have the following layout



        
4条回答
  •  天涯浪人
    2020-12-28 14:23

    If you have layout like this:

    
        
            
            ...
            
        
    
    

    You need to create your own class and override the function in this way:

    class SwipeRefreshLayoutCustom extends SwipeRefreshLayout {
        public SwipeRefreshLayoutCustom(Context context, AttributeSet attributes) {
            super(context, attributes)
        }
        @override
        boolean canChildScrollUp() {
            return your_scroll_view_id.scrollY != 0
        }
    }
    

提交回复
热议问题