Android - SwipeRefreshLayout with empty textview

后端 未结 15 1421
悲哀的现实
悲哀的现实 2020-12-05 02:06

I\'ve implemented SwipeRefreshLayout into my app but it can only hold one direct child which should be the listview. I\'m trying to figure out how to add an emp

15条回答
  •  天命终不由人
    2020-12-05 02:55

    As i mentioned here, i have done this for RecyclerView:

    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.

提交回复
热议问题