我正在使用 android 导航组件来导航片段。我可以通过在 Main Activity 中使用此代码轻松设置操作栏:
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
Run Code Online (Sandbox Code Playgroud)
但是如果我想在某些片段中隐藏 supportActionbar 那么最好的方法是什么?
java android android-fragments android-navigation android-architecture-navigation