Recyclerview inside nested scroll view loading all datas instead of calling one by one image when scroll

后端 未结 2 893

In my application, I\'m using tabHost Activiy.In the tabhost first tab,I\'m using TabActivity,I\'m loading more than 500 images.

Using Nested SCroll view:

2条回答
  •  情书的邮戳
    2020-12-05 11:38

    You can use CoordinatorLayout just about anywhere you like similar to other layouts like LinearLayout or even RelativeLayout. If you want your RelativeLayout to scroll in response to your RecyclerView, simply place them inside a CoordinatorLayout with an AppBarLayout. Here's your layout modified:

    
    
        
    
            
    
                
    
                
                
    
        
    
        
    
    
    

    Change it to your preference but be sure to set the layout_height of the RelativeLayout to something other than wrap_content.

    If this CoordinatorLayout is inside another CoordinatorLayout, use the NestedCoordinatorLayout from this answer as your inside CoordinatorLayout.

提交回复
热议问题