WindowManager创建创建悬浮窗
来源:互联网 发布:使用端口命令 tcp 编辑:程序博客网 时间:2024/05/01 16:23
WindowManager创建悬浮窗,比如音量控制的视图弹窗,一些悬浮按钮,悬浮菜单等
WindowManager mManager = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);//WindowManager管理器RelativeLayout mBottomView = (RelativeLayout) LayoutInflater.from(MainActivity.this).inflate(R.layout.window_bottom, null);//布局资源WindowManager.LayoutParams mParamsBottom = new WindowManager.LayoutParams();//mParamsBottom.type = LayoutParams.TYPE_PHONE;//它置于所有应用程序之上,状态栏之下mParamsBottom.format = PixelFormat.RGBA_8888;mParamsBottom.flags = LayoutParams.FLAG_NOT_TOUCH_MODAL| LayoutParams.FLAG_NOT_FOCUSABLE| LayoutParams.FLAG_NOT_TOUCHABLE;mParamsBottom.gravity = Gravity.LEFT | Gravity.TOP;mParamsBottom.x = 0;//显示的位置mParamsBottom.y = 200mParamsBottom.width = LayoutParams.MATCH_PARENT;mParamsBottom.height = LayoutParams.WRAP_CONTENT;mManager.addView(mBottomView, mParamsBottom);
使用悬浮窗需要如下权限
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
悬浮窗可以根据不同的flag来覆盖
flag相同时,后弹出的覆盖前弹出
找优先级最高的flag
0 0
- WindowManager创建创建悬浮窗
- WindowManager创建悬浮窗的简单例子
- 使用WindowManager创建可拖动的悬浮按钮
- 创建桌面悬浮窗
- windowmanager 悬浮窗效果
- WindowManager实现悬浮窗
- Android WindowManager悬浮窗
- WindowManager悬浮窗TYPE_TOAST
- WindowManager添加悬浮窗
- 使用WindowManager实现悬浮窗
- 利用WindowManager实现悬浮窗
- WindowManager 系统悬浮窗弹出
- 使用WindowManager实现悬浮窗
- WindowManager 实现悬浮窗 详解
- 通过WindowManager创建窗口
- MFC创建悬浮窗口
- 创建悬浮框
- Windowmanager悬浮窗的 WindowManager.LayoutParams.type 属性属性研究
- APT是什么意思?
- 由#pragma once说起
- 关于微信营销 转载
- android 百科
- 算法(全排列算法封装)
- WindowManager创建创建悬浮窗
- java Date类型:24小时制和12小时制
- 支付宝退款服务热线电话是多少【官网认证】
- Java实现登录验证码验证
- 选择排序
- iOS 中十六进制字符串转化为UIColor
- window杀进程命令
- sigmoid函数解析与应用
- 支付宝官方服务电话是多少【官网认证】