android隱藏頭部
㈠ 如何去掉android頭部label的方法
去掉所有Activity中的導航欄:在AndroidManifest.xml文件中定義 去掉某個Activity中的導航欄:在該Activity的onCreate()方法中添加 requestWindowFeature(Window.FEATURE_NO_TITLE);
㈡ 安卓開發app怎麼隱藏手機頭部通知欄
在activity的onCreat中
requestWindowFeature(Window.FEATURE_NO_TITLE);
注意:上面這句話要放在setContentView之前
㈢ 如何去掉android頭部label的方法
1、在AndroidManifest.xml中
把requestWindowFeature()方法添加在setContentView()方法之前,就可以了
㈣ android開發時,怎麼把頭部去掉,去掉圖片,也去掉這個黑的部分,求大神指導啊
在代碼中添加下面這句
requestWindowFeature(Window.FEATURE_NO_TITLE);
注意:必須是在setContentView()之前
㈤ 如何去掉android頭部label的方法
方法一:在AndroidManifest.xml中
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" >
添加theme屬性為NoTitleBar就可以了。
方法二:在MainActivity.java中
@Override
public void onCreate (Bundle savedInstanceState) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
把requestWindowFeature()方法添加在setContentView()方法之前,這個方法只是把標題隱藏了。
㈥ 如何去掉android頭部label的方法
1.AndroidManifest.xml中,將主題設置為NoTitleBar。
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
2.在Activity中,調用requestWindowFeature(Window.FEATURE_NO_TITLE)。
@Override
publicvoidonCreate(BundlesavedInstanceState){
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
㈦ 如何去掉android頭部label的方法
在android中去掉標題欄有三種方法,它們也有各自的特點。
1.在代碼里實現
[java] view plain
this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉標題欄
記住:這句代碼要寫在setContentView()前面。
2.在清單文件(manifest.xml)裡面實現
[java] view plain
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
這樣用可以將整個應用設置成無標題欄,如果只需要在一個Activity設置成一個無標題欄的形式,只要把上面的第三行代碼寫到某一個Activity裡面就可以了。
3.在style.xml文件里定義
[html] view plain
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<style name="notitle">
<item name="android:windowNoTitle">true</item>
</style>
</resources>
然後面manifest.xml中引用就可以了,這種方法稍麻煩了些。
[html] view plain
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/notitle">
其實可以看得出來,第二種方法和第三種方法實質是一樣的,只不過第二種方法調用的是系統定義好的style.xml文件,而第三種方法則是在自己的應用里定義style.xml,然後再自己再調用,其實道理是一樣的,第三種方法做起來更有成就感。
㈧ 如何去掉android頭部label的方法
第一種方法,在代碼里加上
requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉標題欄
第二種方法 在AndroidManifest.xml文件中加上
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
㈨ 如何去掉android頭部label的方法
去掉所有Activity中的導航欄:在AndroidManifest.xml文件中定義
<application android:theme="@android:style/Theme.NoTitleBar">
去掉某個Activity中的導航欄:在該Activity的onCreate()方法中添加
requestWindowFeature(Window.FEATURE_NO_TITLE);