Remove Default Title Bar

前端 未结 9 672
天涯浪人
天涯浪人 2021-02-04 03:34

How do I remove the top title bar that\'s default in an Android app?

\"enter

The g

相关标签:
9条回答
  • 2021-02-04 04:17

    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!

    0 讨论(0)
  • 2021-02-04 04:17

    And also several themes are available without the title bar. For e.g.Theme.AppCompat.Light.NoActionBar applies the respective theme without title bar

    0 讨论(0)
  • 2021-02-04 04:19
    android:theme="@android:style/Theme.NoTitleBar"
    

    inside AndroidManifest.xml I added the code =)

    0 讨论(0)
  • 2021-02-04 04:25

    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>
    
    0 讨论(0)
  • 2021-02-04 04:27

    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>
    
    1. Another method is to add theme attributes to your activity as in manifest file:

      android:theme = "@style/Theme.AppCompat.Light.NoActionBar"

    0 讨论(0)
  • 2021-02-04 04:29
    <style name="MyTheme" parent="@android:style/Theme.NoTitleBar">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowBackground">@drawable/xyz</item>
    </style>
    
    0 讨论(0)
提交回复
热议问题