设置系统栏可见性
2016-06-02 12:28
260 查看
public static void setSystemBarVisible(final Activity context,
boolean visible) {
int flag = context.getWindow().getDecorView().getSystemUiVisibility();
// int fullScreen = View.SYSTEM_UI_FLAG_SHOW_FULLSCREEN;
int fullScreen = 0x8;
if (visible) {
if ((flag & fullScreen) != 0) {
context.getWindow().getDecorView()
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
} else {
if ((flag & fullScreen) == 0) {
context.getWindow().getDecorView()
.setSystemUiVisibility(flag | fullScreen);
}
}
}
boolean visible) {
int flag = context.getWindow().getDecorView().getSystemUiVisibility();
// int fullScreen = View.SYSTEM_UI_FLAG_SHOW_FULLSCREEN;
int fullScreen = 0x8;
if (visible) {
if ((flag & fullScreen) != 0) {
context.getWindow().getDecorView()
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
} else {
if ((flag & fullScreen) == 0) {
context.getWindow().getDecorView()
.setSystemUiVisibility(flag | fullScreen);
}
}
}
相关文章推荐
- Android中<meta-data>的使用
- 用VirtualBox 导入vmware的虚拟机
- PPT演示文稿放映时会议记录的技巧
- 启动系统设置页面
- 删除字符串
- 理解PhotoView的核心,以双击事件为例
- 四舍五入保留两位小数
- CentOS 安装配置vncserver
- array_multisort 对关联数组进行排序的问题 PHP
- 2016第22周四
- iOS 修改状态栏颜色
- C++作业7
- 虚线分割线
- JSP表达式学习中遇到Java compiler level dose not mach the version of the installed问题
- 开发错误记录9:Application无法跳转到Activity
- C#外部类、内部类(嵌套类)之间的成员访问特点
- MITOPENCOURSE6.006的第21个和第22个lecture学习笔记
- 如何编译TrueCrypt 7.0a源码
- poj2632Crashing Robots
- 单片机UART中断应用中TXE和TC的顺序