当前位置: 编程技术>移动开发
android图库竖屏不显示status bar的解决方法
来源: 互联网 发布时间:2014-10-17
本文导语: 图库在JB和JB2的版本上显示的行为是:横屏全屏显示,竖屏会显示status bar。如何使竖屏也不显示status bar。 修改alps/packages/apps/Gallery2/src/com/android/gallery3d/app/AbstractGalleryActivity.java中toggleStatusBarByOrientation() 方法: 代码如下: privat...
图库在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);
// }
...
}