Different Ways to Hide ActionBar in Android with Examples
ActionBar is a primary toolbar within the activity that may display the activity title, application-level navigation affordances, and other interactive items. Although, Action Bar is an important feature for android applications, sometimes we have the need to hide it in either the entire app, or some particular activity, or during some particular work. This article explains and demonstrates various ways to hide the ActionBar in an Android Application. There are various ways to hide Action Bar, demonstrated below:
Different ways to Hide ActionBar
1. Hide ActionBar from the entire App using styles.xml
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.Light.NoActionBar“.
Below is the code snippet for this method and changes are made to styles.xml:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
Источник