Using Toolbar with Fragments

后端 未结 5 2070
小蘑菇
小蘑菇 2020-12-07 13:46

I am trying to create a viewpager that swipes through 3 different fragments each with a different toolbar. I have implemented the new toolbar in an activity before and got i

5条回答
  •  隐瞒了意图╮
    2020-12-07 14:40

    With the new AppCompatActivity you should call it instead of ActionBarActivity:

    ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar);
    

提交回复
热议问题