How to hide action bar for fragment?

前端 未结 9 1188
挽巷
挽巷 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:06

    You can simply put this into your Fragment Class createView method:-

        View layout = inflater.inflate(R.layout.player_fragment, container, false);
        ((AppCompatActivity) getActivity()).getSupportActionBar().hide();
    

提交回复
热议问题