Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing action bar in BottomNavigation view

As the title says I am not able to remove the action bar present in the bottom navigation bar. I tried different NoAction bar themes but it won't work for some reason.

Can someone tell me what am I doing wrong?

Here is the example The screenshot

like image 229
random1132 Avatar asked May 26 '18 17:05

random1132


People also ask

How do I get rid of action bar?

If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.

How do I get rid of the bottom navigation bar on Android?

Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.


2 Answers

  1. Change theme to "Theme.AppCompat.Light.NoActionBar"
  2. Remove codes below
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notification).build();
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
like image 109
Ryan Avatar answered Oct 04 '22 04:10

Ryan


try the below code. Just copy the code and add in your styles.xml

 <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
</style>

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>
like image 20
hemandroid Avatar answered Oct 04 '22 04:10

hemandroid