How to hide action bar for fragment?

前端 未结 9 1186
挽巷
挽巷 2021-01-31 08:17

How can I hide action bar for certain fragment? I have searched for the answer at stackoverflow, but I have only found a solution, which involves disabling action bar for main a

9条回答
  •  迷失自我
    2021-01-31 09:00

    Put getSupportActionBar().hide() before setContentView in the Activity that holds the fragments.

    Also add this: ((AppCompatActivity) getActivity()).getSupportActionBar().hide() in the fragments before inflating layout. This works if you are using this ActionBarActivity.It also removes my lags in hiding action bar

提交回复
热议问题