标签:
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
标签:
原文地址:http://www.cnblogs.com/zzw1994/p/4985520.html