首页 > 移动平台 > 详细

使APP默认全屏的代码

时间:2015-11-22 12:31:02      阅读:282      评论:0      收藏:0      [点我收藏+]
 1  public void toggleFullscreen(boolean fullScreen) {
 2         // fullScreen为true时全屏,否则相反
 3 
 4         WindowManager.LayoutParams attrs = getWindow().getAttributes();
 5 
 6         if (fullScreen) {
 7             attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
 8         } else {
 9             attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
10         }
11 
12         getWindow().setAttributes(attrs);
13     }

要使用的时候直接调用方法boolean为true

使APP默认全屏的代码

原文:http://www.cnblogs.com/zzw1994/p/4985520.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!