How do I remove the top title bar that\'s default in an Android app?
The g
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!
And also several themes are available without the title bar. For e.g.Theme.AppCompat.Light.NoActionBar
applies the respective theme without title bar
android:theme="@android:style/Theme.NoTitleBar"
inside AndroidManifest.xml I added the code =)
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>
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"
<style name="MyTheme" parent="@android:style/Theme.NoTitleBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@drawable/xyz</item>
</style>