Remove app title bar android

后端 未结 9 1320
失恋的感觉
失恋的感觉 2020-12-15 05:11

I know this question has been asked million times but whichever method I use is not good for me.

If I use

android:theme=\"@android:style/Theme.NoTit         


        
相关标签:
9条回答
  • 2020-12-15 05:42

    If you add the theme to the application, it applies to the whole app.

    android:theme="@android:style/Theme.NoTitleBar"
    

    You have to add it to the activity declaration.

    <activity
        android:name=".YourActivity"
        android:theme="@android:style/Theme.NoTitleBar"/>
    
    0 讨论(0)
  • 2020-12-15 05:45

    This is what worked for me

     android:theme="@style/Theme.AppCompat.NoActionBar">
    
    0 讨论(0)
  • 2020-12-15 05:46

    For android 8 and above support. Use this in your app theme file. I've modified my default in res/styles.xml :

    <style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:background">@color/white</item>
    </style>
    
    0 讨论(0)
提交回复
热议问题