How to use a TabLayout with Toolbar inside CollapsingToolbarLayout?

后端 未结 18 2310
逝去的感伤
逝去的感伤 2020-11-27 11:46

I am looking at the chrisbanes/cheesesquare and I am trying to put TabLayout with a Toolbar inside a CollapsingToolbarLayout, and here is my code



        
18条回答
  •  被撕碎了的回忆
    2020-11-27 12:01

    All above codes are collapsing only "CollapsingtoolbarLayout" components. That means if we scroll the page of "ViewPager" content, it is not working.

    I replace the "ViewPager" by "FrameLayout" now it is working, what we expecting.

    I am expecting like, if scroll the page of Viewpager then "CollapsingToolbarLayout" should be listen. for this I used the "NestedScrollView". But problem is "ViewPager" not working in "NestedScrollView".

    So finally I achieved with FrameLayout.

    But problem is "tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {" is depricated

    
    
        
    
        
    
            
    
                
    
    
                
                    
                        
                    
    
                
    
                
    
                
    
            
    
        
        
    
      
    
      
    
    
    
    
        
    

    Creating The Tablayout with out ViewPager : http://www.theappguruz.com/blog/easy-way-to-create-tab-layout-in-android-without-viewpager

提交回复
热议问题