在Android 7.0上PopupWindow.showAsDropDown不起作用的解决方法
来源:互联网 发布:网络免费打电话啥软件 编辑:程序博客网 时间:2024/05/20 11:51
/** * Created by twy on 2017/7/7. */public class MyPopWindow extends PopupWindow { public MyPopWindow(final Activity context,View view){ LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); int h = context.getWindowManager().getDefaultDisplay().getHeight(); int w = context.getWindowManager().getDefaultDisplay().getWidth(); this.setContentView(view); this.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); this.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); this.setFocusable(true); this.setOutsideTouchable(true); this.update(); ColorDrawable dw = new ColorDrawable(-00000); this.setBackgroundDrawable(dw); this.setAnimationStyle(R.style.AnimationPreview); } @Override public void showAsDropDown(View anchor) { if (Build.VERSION.SDK_INT == 24) { Rect rect = new Rect(); anchor.getGlobalVisibleRect(rect); int h = anchor.getResources().getDisplayMetrics().heightPixels - rect.bottom; setHeight(h); } super.showAsDropDown(anchor); }}
阅读全文
0 0
- 在Android 7.0上PopupWindow.showAsDropDown不起作用的解决方法
- 在Android 7.0上PopupWindow.showAsDropDown不起作用的解决方法
- 在Android 7.0上PopupWindow.showAsDropDown不起作用的解决方法
- 在Android 7.0上PopupWindow.showAsDropDown不起作用
- 解决在Android 7.0上PopupWindow.showAsDropDown不起作用
- PopupWindow的使用showAsDropDown()无法dismiss解决方法
- Android 7.0 PopupWindow 的showAsDropDown(View v)适配
- android popupwindow showAsDropDown offsetx无效的问题
- Android7.0 popupwindow showAsDropDown在屏幕上方弹出解决方法
- [问题解决]Android7.0上PopupWindow的showAsDropDown位置问题
- Android7.0上PopupWindow的showAsDropDown位置问题
- Android7.0上PopupWindow的showAsDropDown位置问题
- Android7.0上PopupWindow的showAsDropDown位置问题 参数无效
- PopupWindow在android7.0+的update、showAsDropDown方法
- android 7.0 PopupWindow中ShowAsDropDown()方法不适配的解决方案
- Android开发之PopupWindow的showAtLocation()和showAsDropDown()
- Popupwindow的showAsDropDown方法详解
- PopupWindow的showAsDropDown位置问题 Android7.0
- 国内外从事CV相关的企业
- 使用ZXing实现二维码扫描
- 自定义webview长按文本弹出选项,并且点击后返回选项与所选中的文本
- JS中typeof与instanceof的区别
- Android开发中使用inflate方法宽高适配
- 在Android 7.0上PopupWindow.showAsDropDown不起作用的解决方法
- 一文读懂大数据平台——写给大数据开发初学者的话!
- 2017计算机岗位需求
- Cesium学习笔记(四)Camera
- Java线程池使用说明
- mongo查询方法汇总
- CSS3背景属性和渐变
- 删除链表中的元素
- Matlab绘图-很详细,很全面