隐藏状态栏时,整体布局不会往上挪的办法
来源:互联网 发布:网络教学系统uml 编辑:程序博客网 时间:2024/06/02 12:38
Launcher开发的时候有个需求是长按图标时,要隐藏状态栏弹出卸载框。但是发现隐藏状态栏的时候workspace会整体往上挪,要想隐藏状态栏时布局不变,需要先在主题属性里加两个属性就好了:
<style name="Theme" parent="@android:style/Theme.Holo.Wallpaper.NoTitleBar"> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> </style>
代码里隐藏和显示状态栏的代码:
public void showStatusBar() {// if (mLauncherView != null) {// mLauncherView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.VISIBLE);// } WindowManager.LayoutParams attrs = getWindow().getAttributes(); attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN; getWindow().setAttributes(attrs); } public void hideStatusBar() {// if (mLauncherView != null) {// mLauncherView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.INVISIBLE);// } WindowManager.LayoutParams attrs = getWindow().getAttributes(); attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; getWindow().setAttributes(attrs); }
0 0
- 隐藏状态栏时,整体布局不会往上挪的办法
- 隐藏标题栏状态栏的办法
- 隐藏软键盘的时候,页面或者布局往上跳动的解决办法
- 隐藏状态栏 view不自动上调解决的办法
- 解决点击edittext,弹出软键盘时布局往上顶的问题
- Android 解决沉浸式状态栏下,输入法弹出,布局不会自动调整的BUG
- 隐藏状态栏的方法
- iOS7的状态栏隐藏
- 标题、状态栏的隐藏
- iOS 状态栏的隐藏
- iOS 状态栏的隐藏
- 状态栏隐藏的问题
- 显示/隐藏状态栏,activity重新布局解决方法
- 隐藏radio的办法
- 关于当EditText软键盘打开时,界面整体往上移动
- 隐藏状态栏的web地址
- iphone隐藏顶部的状态栏
- Android中状态栏的隐藏
- 关于c语言#include的用法
- Android 打造形形色色的进度条 实现可以如此简单
- Android开发库VUtils之关联代码行的log
- ZOJ 2797 106 miles to Chicago(多校连萌,用最短路径求概率问题)
- Android——Scroll分析
- 隐藏状态栏时,整体布局不会往上挪的办法
- Android--使用融云SDK开发即时聊天(三)----启用客服
- C#知识点总结
- socket、tcp、udp、http 的认识及区别
- VC++的Unicode编程
- 自定义UIAlertController
- EXISTS、IN与JOIN性能分析
- spark初试遇到的小问题
- 双向链表的基本操作