android - 去掉activity顶部的title bar

访问量: 185

参考:  https://stackoverflow.com/a/40207993/445908

1- in styles.xml:

<style name="generalnotitle" parent="Theme.AppCompat.Light" >
          <item name="android:windowNoTitle">true</item>  
</style>
2- in MainActivity

@Override
protected void onCreate(Bundle savedInstanceState) {          
    
    getSupportActionBar().hide(); 

}

3 in manifest inherit the style:

<activity android:name=".MainActivity" android:theme="@style/generalnotitle">

订阅/RSS Feed

Subscribe

分类/category