android图库竖屏不显示status bar的解决方法
程序员文章站
2023-12-04 21:25:40
图库在jb和jb2的版本上显示的行为是:横屏全屏显示,竖屏会显示status bar。如何使竖屏也不显示status bar。 修改alps/packages/apps/g...
图库在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);
// }
...
}