Android support v4 SwipeRefreshLayout empty view issue

后端 未结 9 1245
耶瑟儿~
耶瑟儿~ 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 19:00

    As @Dinesh written above, i have used clickable="true" like below with empty RecyclerView:

    mRecyclerView.setVisibility(View.VISIBLE);
    mRecyclerView.setClickable(true);
    myText.setVisibility(View.VISIBLE);
    

    xml layout:

    
    
        
    
            
        
    
    
        
    
    
    

    RecyclerView has height match_parent and SwipeRefresh has wrap_content. When there is item in list, don't forget to make text gone.

提交回复
热议问题