How can I hide the title Bar from the activity_main
layout? I have android studio 1.3.1 and I used the android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
within the activity tag but when I see the activity_main
again I see the title Bar or the same action Bar again. How can I hide it?
Asked
Active
Viewed 208 times
1

stackoverflow
- 39
- 3
-
Do you want to hide the entire ActionBar or just display an empty title ? – forcewill Aug 31 '15 at 12:53
-
1try http://stackoverflow.com/a/2627952/5202007 – Mohammad Tauqir Aug 31 '15 at 12:54
2 Answers
0
Put this code below the AppTheme in your styles.xml file whixh is in values directory.
<style name="MyThemeNoTitle" parent="AppTheme">
<item name="android:windowNoTitle">true</item>
</style>
And in your Manifest.xml file put theme tag to your activity as,
<activity
android:name="MainActivity"
android:label="@string/app_name"
android:theme="@style/MyThemeNoTitle">

Rohit Jagtap
- 1,660
- 1
- 14
- 12
0
You can define this theme with no ActionBar and which is also supported in all Android versions:
<style name="Base.AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
After you can apply this theme as the theme of the entire application or just for your MainActivity in the manifest with the attribute android:theme

Yiyo Castillo
- 225
- 2
- 14