How to use a TabLayout with Toolbar inside CollapsingToolbarLayout?

后端 未结 18 2306
逝去的感伤
逝去的感伤 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:13

    I had a similar problem, and my solution was ridiculously simple. All I had to do was setting the toolbar as the support actionbar (I am using a Theme.NoActionBar style base)

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    

提交回复
热议问题