How to show a custom actionbar view from one fragment only

后端 未结 2 1694
梦谈多话
梦谈多话 2021-01-24 05:17

I have a requirement for my app that a custom action bar view be shown from one fragment only (the landing page fragment). The problem is that this action bar is appearing when

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-24 05:54

    Well, I'm just trying to suggest. Why not removing the action bar to all the fragments and just creating a single fragment (the landing page) with a custom action bar thru layout?

    To remove ActionBar to all fragments, add this code to tag:

    android:theme="@android:style/Theme.Light.NoTitleBar"

    Create a Layout with action bar for your landing page through xml:

    
    
    
    
    
    
    

提交回复
热议问题