How do I remove the top title bar that's default in an Android app?
The gray Hello, Android bar?
How do I remove the top title bar that's default in an Android app?
The gray Hello, Android bar?
Its very simple to remove the title bar Just, Add the android:theme property to your AndroidManifest.xml
<application android:theme="@android:style/Theme.NoTitleBar">
<style name="MyTheme" parent="@android:style/Theme.NoTitleBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@drawable/xyz</item>
</style>
Go into manifest file
Click the "Application" tab on the bottom (as shown)
Enter @android:style/Theme.NoTitleBar
(as shown)
To do that I declared a style inheriting everything from my general style. This style disabled the default Android titleBar.
<style name="generalnotitle" parent="general">
<item name="android:windowNoTitle">true</item>
</style>
Create a new style and add this style in your different views or add this code in the default style to disabled the titleBar for all windows!
This problem occurs when you are using default inbuilt toolbar and your own custom toolbar. There are two method.
1) Navigate to Values/style.xml <---Base Application theme styles to-> and change your parent theme like:
<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>
</style>
Another method is to add theme attributes to your activity as in manifest file:
android:theme = "@style/Theme.AppCompat.Light.NoActionBar"
Try this:
requestWindowFeature(Window.FEATURE_NO_TITLE);
And also several themes are available without the title bar. For e.g.Theme.AppCompat.Light.NoActionBar
applies the respective theme without title bar
For Android Studio 2.2.2, 2016
Replace in app/src/main/res/values/styles.xml
the parent Theme.AppCompat.Light.DarkActionBar
on Theme.AppCompat.NoActionBar
Example:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
android:theme="@android:style/Theme.NoTitleBar"
inside AndroidManifest.xml I added the code =)