我试图通过使用下面的代码隐藏root root平板电脑。但上方通知栏也隐藏了底栏,但我不想隐藏上方通知栏。
是否可以仅隐藏底部导航栏?
public static void hideSystemBottomBar() {
Process proc = null;
String ProcID = "79"; // HONEYCOMB AND OLDER
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
ProcID = "42"; // ICS AND NEWER
}
try {
proc = Runtime.getRuntime().exec(
new String[] {
"su",
"-c",
"service call activity " + ProcID
+ " s16 com.android.systemui" });
proc.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
try {
proc.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
答案 0 :(得分:0)
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
注意:它应该高于 setContentView (R.layout.activity_main);