PopupWindow 用法 PopupWindow不消失 解决方法
来源:互联网 发布:数据分析师报考 编辑:程序博客网 时间:2024/06/14 01:32
PopupWindow创建
popupWindow = new PopupWindow(getLayoutInflater().inflate(R.layout.newpopupwindow, null),300,300);popupWindow.setFocusable(true);popupWindow.setBackgroundDrawable(Test.this.getResources().getDrawable(R.drawable.ic_launcher));popupWindow.setOutsideTouchable(true);popupWindow.showAsDropDown(v, 0,0);
其中
</pre><pre name="code" class="html">popupWindow = new PopupWindow(getLayoutInflater().inflate(R.layout.newpopupwindow, null),300,300);<pre name="code" class="html">popupWindow = new PopupWindow(getLayoutInflater().inflate(R.layout.newpopupwindow, null),300,300,true);<pre name="code" class="html">popupWindow = new PopupWindow(getLayoutInflater().inflate(R.layout.newpopupwindow, null),300,300,false);
这三者没区别
API解释为 <span style="font-family: Arial, Helvetica, sans-serif;">A popup window that can be used to display an arbitrary view. The popup window is a floating container that appears on top of the current activity.</span>其中new PopupWindow 中的第一个参数为自定义的view 后面两个分别为PopupWindow宽和高
.setFocusable() 设置PopupWindow 是不是能接受焦点
.setoutsideTouchable PopupWindow外面能不能点击 点击之后会使PopupWindow 消失 dismiss()
showASDropDown 显示的方式
假如设置了 setBackgroundDrawable 就算没有设置 .setoutsideTouchable 也可以点击popupwindow之外的地方使popupwindow消失
只设置了 setfocusable 而没设置 setbackgroundDrawable 点击Popupwindow 之外的地方 popupwindow不消失
PopupWindow 无法消失的情况 解决方法:
1.只设置了 setfocusable 而没设置 setbackgroundDrawable 点击Popupwindow 之外的地方 popupwindow不消失
2.showAsDropDown 在PopWindow设置完setbackgrounddrawable之前就已经执行了
0 0
- PopupWindow 用法 PopupWindow不消失 解决方法
- PopupWindow 用法 PopupWindow不消失 解决方法
- PopupWindow,不消失
- PopupWindow用法
- PopupWindow 用法
- PopupWindow用法
- popupwindow用法
- PopupWindow用法
- PopupWindow用法
- PopupWindow用法
- PopupWindow用法
- PopupWindow用法
- PopupWindow用法
- PopupWindow用法
- 点击PopupWindow外部消失
- popupWindow点击外面消失
- PopupWindow点击界外消失
- PopupWindow 点击其他地方消失
- ios编程——使用抽屉MMDrawerController和系统手势interactivePopGestureRecognizer冲突的解决方法
- django admin
- zookeeper3.4.5自动清理日志
- 怎么使点击一个popupwindow窗口之外的区域popupwindow消失呢?
- 关于用MDK定义无法跳转的问题
- PopupWindow 用法 PopupWindow不消失 解决方法
- linux启动svn
- 第二十一届全国青少年信息学奥林匹克联赛 “华东师大二附中”杯上海赛区竞赛规程
- How to Check Whether Oracle Binary/Instance is RAC Enabled and Relink Oracle Binary in RAC (文档 ID 28
- libxml主要函数说明
- ABAP检查日期时间合法性的函数
- swf文件的正确打开方式
- 设计模式 之 单例模式
- 排序总结*(雯)