1

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?

2 Answers2

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