国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Android > 正文

Android4.0平板開發(fā)之隱藏底部任務(wù)欄的方法

2020-04-11 11:15:19
字體:
供稿:網(wǎng)友

本文實(shí)例講述了Android4.0平板開發(fā)之隱藏底部任務(wù)欄的方法。分享給大家供大家參考,具體如下:

復(fù)制代碼 代碼如下:
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);//隱藏底部任務(wù)欄代碼

上邊已驗(yàn)證

下邊百度過來的

showBar顯示任務(wù)欄

closeBar隱藏任務(wù)欄

前提:需要ROOT權(quán)限

public static void showBar() {   try {      Process proc = Runtime.getRuntime().exec(        new String[] { "am", "startservice", "-n",          "com.android.systemui/.SystemUIService" });      proc.waitFor();    } catch (Exception e) {      e.printStackTrace();    }  }  public static void closeBar(Context context) {    try {     // 需要root 權(quán)限      Build.VERSION_CODES vc = new Build.VERSION_CODES();      Build.VERSION vr = new Build.VERSION();      String ProcID = "79"; if (vr.SDK_INT >= vc.ICE_CREAM_SANDWICH) {        ProcID = "42"; // ICS AND NEWER     }    // 需要root 權(quán)限     Process proc = Runtime.getRuntime().exec(  new String[] {         "su",         "-c",         "service call activity " + ProcID           + " s16 com.android.systemui" }); // WAS 79     proc.waitFor();    } catch (Exception ex) {      Toast.makeText(context, ex.getMessage(), Toast.LENGTH_LONG).show();    } }

1.ActionBar:

<activity android:name="Demo"   android:label="@string/app_name"   android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > <intent-filter>  <action android:name="android.intent.action.MAIN" />  <category android:name="android.intent.category.LAUNCHER" /> </intent-filter></activity>

2.TitleBar

隱藏:

復(fù)制代碼 代碼如下:
requestWindowFeature(Window.FEATURE_NO_TITLE);

或者
復(fù)制代碼 代碼如下:
android:theme="@android:style/Theme.Black.NoTitleBar

顯示:
復(fù)制代碼 代碼如下:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

3.NotificationBar、StatusBar、SystemBar

Dim的話可以:

getWindow().getDecorView().setSystemUiVisibility (View.SYSTEM_UI_FLAG_LOW_PROFILE); 

隱藏的話可以(不好使,哈哈):

getWindow().getDecorView().setSystemUiVisibility (View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

那怎么玩呢?用狠招吧,哈哈:

命令行方式:

直接用進(jìn)程號(hào)殺,不加service那個(gè)shell的話,一會(huì)SystemBar會(huì)自啟動(dòng)。

# kill com.android.systemui# service call activity 79 s16 com.android.systemui

如果想啟動(dòng)SystemBar:

復(fù)制代碼 代碼如下:
# am startservice -n com.android.systemui/.SystemUIService

代碼方式:

要root啊

Process proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity 79 s16 com.android.systemui"});proc.waitFor();Process proc = Runtime.getRuntime().exec(new String[]{"am","startservice","-n","com.android.systemui/.SystemUIService"});proc.waitFor();

希望本文所述對(duì)大家Android程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 兴海县| 景洪市| 万盛区| 武隆县| 璧山县| 巩留县| 阜南县| 宣城市| 株洲县| 溧水县| 渭南市| 临桂县| 封开县| 宁化县| 大埔区| 陆河县| 大名县| 同仁县| 密山市| 鹤庆县| 宜兴市| 拜泉县| 三亚市| 织金县| 满城县| 高清| 北宁市| 安丘市| 如东县| 武清区| 玉溪市| 高州市| 景德镇市| 静乐县| 隆子县| 固镇县| 徐汇区| 长泰县| 凌海市| 新竹县| 陆良县|