Android Studio - Action Bar remove

前端 未结 8 1586
时光说笑
时光说笑 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:17

    I had this issue too. I went to styles.xml and changed

    parent="Theme.AppCompat.Light.DarkActionBar" 
    

    to

    parent="Theme.AppCompat.Light.NoActionBar"
    

    and that removed it from all my activities.

    0 讨论(0)
  • 2020-12-24 03:17

    For android studio You can go to styles.xml and change

    parent="Theme.AppCompat.Light.DarkActionBar"
    

    to

    parent="Theme.AppCompat.Light.NoActionBar" 
    

    and in Eclipse it can be changed in manifest file

      <activity
            android:name="com.ExcellenceTech.webview.MainActivity"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" >
    
    0 讨论(0)
  • 2020-12-24 03:18
    getActionBar().hide();
    

    I think this should work.

    0 讨论(0)
  • 2020-12-24 03:27

    You hide action bar by with different ways.

    1.action bar hidden through the manifest xml file (non Java Programming), then the easy way is to add the following attribute in Activity tag:

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

    If custom Theme is created then it is convenient to create another style extending the custom theme.

     <item name="android:windowActionBar">false</item>
     <item name="android:windowNoTitle">true</item>
    

    or

    ActionBar actionBar = getActionBar(); OR getSupportActionBar();
    actionBar.hide();
    
    getSupportActionBar().hide(); 
      or 
    getActionBar().hide();
    
    0 讨论(0)
  • 2020-12-24 03:30

    In AndroidManifest.xml and acitivity section put this code.

    android:theme="@style/Theme.AppCompat.Light.NoActionBar"
    
    0 讨论(0)
  • 2020-12-24 03:31
    getActionBar().hide();
    

    or

    getSupportActionBar().hide();
    

    But the change might not appear in the xml design.

    0 讨论(0)
提交回复
热议问题