Android support v4 SwipeRefreshLayout empty view issue

后端 未结 9 1220
耶瑟儿~
耶瑟儿~ 2021-01-01 18:01

SwipeRefresh is not working after setting an empty view for listview which is the only child of a SwipeRefresh layout. How to solve this issue?

9条回答
  •  渐次进展
    2021-01-01 18:42

    Here is the solution: You can simply use this view hierarchy :

        
    
            
    
                
            
    
            
        
    

    Then, in code, you just call:

    _listView.setEmptyView(findViewById(android.R.id.empty));
    

    That's it.

提交回复
热议问题