转载请注明:
http://blog.csdn.net/u012184853/article/details/50157261
android 去除标题栏titlebar的两种方式:
方式一:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
在需要消除的activity中添加如上代码, 注意: 代码需要加在onCreate()方法中,而且需要在setContentView()之前
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
}
方式二:
在AndroidManifest.xml中设置主题
android:theme="@android:style/Theme.NoTitleBar"
<activity
android:name="com.jingchen.tbviewer.MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>