AppBarLayout with recyclerView in nested fragment

前端 未结 3 1366
长情又很酷
长情又很酷 2020-12-31 12:58

As images are always better than words, I present to you my current layout.

The toolbar/tabs is in an activity.xml with a viewPager, and the recycle

3条回答
  •  耶瑟儿~
    2020-12-31 12:58

    I think the key for solving your problem is removing the Coordinatorlayout from the recycler view layout.

    This is the acitivity_main.xml inflated by the MainActivity with a placeholder layout to include

    
    
    
        
    
    
        
    
    

    This is the content layout with the tabs, appBar and ViewPager

    
    
    
    
        
    
            
    
            
    
        
    
    
        
    
    
    

    And finally, the RecyclerView layout inflated by a fragment.

    
    
    

    If you want a good reference code you can check the awesome demo created by Chris Banes from Google of the CoordinatorLayout and other design support library features.

    The full source code can be found on github. This was the easiest way for me to understand the logic behind it.

    I Hope it helps. (I've finally posted something here! :D)

提交回复
热议问题