How to Remove the Title Bar in All Android Studio Activities
When creating a new project in Android Studio, of course you will be asked to fill in a number of forms such as project name, project package and where the project is located. After the build, automatically in the layout view will write the name of the project that you created precisely in the Title Bar of each Activity.
The existence of the project name is indeed annoying and indeed it should be eliminated so that the Activity display becomes cleaner and appears fullscreen. To delete the Title Bar in all Activity in the Android application project, it’s very easy. Follow the following short tutorial:
How to delete Android Studio Title Bar Activity
- Open Android Studio and select the project that will remove the Title Bar Activity.
- Then open styles.xml and replace the code with the following:
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.DarkActionBar"><item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
- Then replace android: theme = “@ style / AppTheme” becomes android: theme = “@ style / AppTheme.NoActionBar” on the file AndroidManifest.xml.
- Then the title bar will automatically disappear and appear fullscreen.
If you only want to display the title bar in a certain activity, you can put android: theme = “@ style / AppTheme.NoActionBar” under the activity you want and place in the file AndroidManifest.xml. An example can be seen in the code below:
<!-- Before -->android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<!-- After -->
<activity
android:name=".MainActivity"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<activity>
So it is enough to add the code style to each activity that is needed only, but if the initial concept does look Fullscreen should remove all title bars in the Android activity so that the display becomes cleaner. Remember in the file styles.xml the previous code is replaced with the code above, because when you only put the code without removing it first, certainly will not change.
It is also possible that this code will not work in all API versions, so tell your API version in the comments column if this does not work and I will update how to delete the Title Bar in all Activity in Android Studio.
0 Response to "How to Remove the Title Bar in All Android Studio Activities"
Post a Comment