How to remove the title when launching android app?

前端 未结 12 1930
死守一世寂寞
死守一世寂寞 2021-02-06 10:43

I already remove the title in onCreate() method.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(         


        
相关标签:
12条回答
  • 2021-02-06 11:15

    It might be crashing because you are using this.requestWindowFeature(Window.FEATURE_NO_TITLE); after setContentView();

    Use this.requestWindowFeature(Window.FEATURE_NO_TITLE); in onCreate() of your Activity , before setContentView(); statement.

    0 讨论(0)
  • 2021-02-06 11:16

    May be i am repeating the same which all are saying but i just need to confirm it.In manifest file have add the theme like the below which i added as sample or anyother way.

    <application .... android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:largeHeap="true"> .. </application>

    Just remove all other code related to hide title bar only andonly add this one in the manifest file it works for me.I hope it will work to you too.

    0 讨论(0)
  • 2021-02-06 11:23

    in res/values/styles.xml

    find ...

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
       <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    </style>
    

    replacing for.

    <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
        <item name="windowActionBar">false</item>
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    </style>
    

    Save and compile...

    0 讨论(0)
  • 2021-02-06 11:24

    In your AndroidManifest.xml in application tag set your theme to full screen like in below code.

    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    
    0 讨论(0)
  • 2021-02-06 11:25

    I had the same problem.

    Personally, I solved it by replacing my Activity inheritance from ActionBarActivity to Activity.

    Hope this will help someone...

    0 讨论(0)
  • 2021-02-06 11:25

    You can simply add full screen theme to that activity in your manifest file:

    android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
    
    0 讨论(0)
提交回复
热议问题