去除标题栏title其实非常简单,他有两种方法,一种是在代码中添加,另一种是在AndroidManifest.xml
中添加:
1、在代码中实现:
在此方法setContentView(R.layout.main)
之前加入:
requestWindowFeature(Window.FEATURE_NO_TITLE);
标题栏就没有了。
2、在AndroidManifest.xml
中实现:
注册Activity
时加上如下的一句配置就可以实现。
<activity android:name=".Activity">
android:theme="@android:style/Theme.NoTitleBar"
</activity>
/* 通过findViewById 构造三个对象*/
mImageButton1 = (ImageButton) findViewById(R.id.image_Button );
mButton1 = (Button) findViewById(R.id.normal_Button );
mTextView1 = (TextView) findViewById(R.id.show_TextView);
网友评论