Android中去掉显示标题的方法

来源:互联网 发布:惠州淘宝培训班 编辑:程序博客网 时间:2024/04/30 21:01



方式一:

在activity中设置主题

  <style name="AppTheme" parent="AppBaseTheme">        <!-- 取消标题 -->         <item name="android:windowNoTitle">true</item>        <!-- All customizations that are NOT specific to a particular API-level can go here. -->    </style>


方式二:

在代码中设置
在Activity的onCreate方法中
在setContentView设置布局前使用
@Overrideprotected void onCreate(Bundle savedInstanceState) {requestWindowFeature(Window.FEATURE_NO_TITLE)super.onCreate(savedInstanceState);setContentView(R.layout.activity_dianchi);}


1 0