Android开发

android图库竖屏不显示status bar的解决方法

本文主要是介绍android图库竖屏不显示status bar的解决方法,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
图库在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);
// }
...
}
这篇关于android图库竖屏不显示status bar的解决方法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!