Android Studio - Action Bar remove

前端 未结 8 1587
时光说笑
时光说笑 2020-12-24 03:05

I\'m trying to remove/disable the ActionBar. I tried to put in the Manifest:



        
相关标签:
8条回答
  • 2020-12-24 03:33

    in your oncreate() method use this

    getActionBar().hide();
    

    If your minSdkVersion is 10 or lower, instead use:

    getSupportActionBar().hide();
    
    0 讨论(0)
  • 2020-12-24 03:34

    You can try this. It works for me

    Add it in style.xml

    <style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
          <item name="windowActionBar">false</item>
          <item name="windowNoTitle">true</item>
          <item name="android:windowFullscreen">true</item>
    </style>
    

    and use the style at manifest.xml.

    android:theme="@style/AppTheme.NoActionBar"
    
    0 讨论(0)
提交回复
热议问题