android图库竖屏不显示status bar的解决方法
时间:2021-08-05 08:30:34|栏目:Android代码|点击: 次
图库在JB和JB2的版本上显示的行为是:横屏全屏显示,竖屏会显示status bar。如何使竖屏也不显示status bar。
修改alps/packages/apps/Gallery2/src/com/android/gallery3d/app/AbstractGalleryActivity.java中toggleStatusBarByOrientation() 方法:
private void toggleStatusBarByOrientation() {
if (mDisableToggleStatusBar) return;
Window win = getWindow();
win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
// if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
// win.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
// } else {
// win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
// }
...
}
修改alps/packages/apps/Gallery2/src/com/android/gallery3d/app/AbstractGalleryActivity.java中toggleStatusBarByOrientation() 方法:
复制代码 代码如下:
private void toggleStatusBarByOrientation() {
if (mDisableToggleStatusBar) return;
Window win = getWindow();
win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
// if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
// win.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
// } else {
// win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
// }
...
}
栏 目:Android代码
下一篇:android设备不识别awk命令 缺少busybox怎么办
本文标题:android图库竖屏不显示status bar的解决方法
本文地址:http://www.codeinn.net/misctech/164232.html