Android實現全屏顯示的方法

2021-07-07 07:38:58 字數 999 閱讀 1582

1、在androidmanifest.xml的配置檔案裡面的標籤新增屬性:

android:theme="@android:style/theme.notitlebar.fullscreen"

2、在activity的oncreate()方法中的super()和setcontentview()兩個方法之間加入下面兩條語句:

//去掉標題欄

this.requestwindowfeature(window.feature_no_title);

//去掉資訊欄

this.getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen);

示例

方法一:

<?xml version="1.0" encoding="utf-8"?>

""package="test.ts.wader.image"

android:versioncode="1"

android:versionname="1.0" >

"7" />

android:name=".imagelistactivity"

android:theme="@android:style/theme.notitlebar.fullscreen">

"android.intent.action.main" />

"android.intent.category.launcher" />

方法二:

public classimagelistactivityextendsactivityimplementsonitemclicklistener

}

android實現全屏顯示

兩種方法 一 在清單檔案中 需要全屏的activity標籤下新增 android theme android style theme.notitlebar.fullscreen 二 在 中 在初始化activity時oncreate方法中,載入布局 setcontentview 之前 去掉標題欄顯示...

Android實現全屏顯示的方法

我們都知道在android中某些功能的實現往往有兩種方法 一種是在xml檔案中設定相應屬性,另一種是用 實現。同樣android實現全屏顯示也可以通過這兩種方法實現 1 在androidmanifest.xml的配置檔案裡面的標籤新增屬性 android theme android style th...

Android實現全屏顯示的方法

我們都知道在android中某些功能的實現往往有兩種方法 一種是在xml檔案中設定相應屬性,另一種是用 實現。同樣android實現全屏顯示也可以通過這兩種方法實現 1 在androidmanifest.xml的配置檔案裡面的標籤新增屬性 android theme android style th...