[问题解决]Android7.0上PopupWindow的showAsDropDown位置问题
来源:互联网 发布:车载手机支架推荐知乎 编辑:程序博客网 时间:2024/04/29 16:02
[问题解决]Android7.0上PopupWindow的showAsDropDown位置问题
/** * Created by diql on 2017/02/16. */
问题说明
我的popupWindow是用来展示listView的,近期在Android7.0手机上测试发现showAsDropDown(view)
展示时发现会充满屏幕,而不是展示在view
的下方,测试发现在7.0以下和7.1系统下都没有类似问题。
问题解决
重写showAsDropDown(view)
,如下:
@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); }
3 0
- [问题解决]Android7.0上PopupWindow的showAsDropDown位置问题
- Android7.0上PopupWindow的showAsDropDown位置问题
- Android7.0上PopupWindow的showAsDropDown位置问题
- Android7.0上PopupWindow的showAsDropDown位置问题 参数无效
- PopupWindow的showAsDropDown位置问题 Android7.0
- Android7.0中PopupWindow(showAsDropDown())弹出位置异常问题
- Android7.0中PopupWindow的showAsDropDown异常问题
- android7.0-PopupWindow-showAsDropDown
- Android7.0 popupWindow显示位置的问题
- PopupWindow在Android7.0和7.1系统上显示位置不正确的问题解决
- PopupWindow在android7.0+的update、showAsDropDown方法
- 解决android7.0popupwindow弹出框位置不正确的问题
- Android7.0 popupwindow showAsDropDown在屏幕上方弹出解决方法
- Android7.0 7.1 popupwindow showAsDropDown 显示异常解决办法
- android popupwindow showAsDropDown offsetx无效的问题
- Android7.0中PopupWindow弹出位置异常问题
- 解决PopupWindow在android7.0弹出位置错误问题
- Android7.0中PopupWindow弹出位置不正常问题
- java中向文本文件中读取数据之使用BufferedReader类
- 双线性插值算法ARM NEON优化
- nodeJS基础学习
- Eclipse 一直提示 loading descriptor for 的解决方法
- STL 算法
- [问题解决]Android7.0上PopupWindow的showAsDropDown位置问题
- TCP连接状态图解析
- Realm For Android详细教程
- Device supports x86, but APK only supports armeabi-v7a
- 发送信息到URL上
- RestFul WebService的创建和使用实例
- Cordova android框架详解
- TCP三次握手/四次挥手的作用
- [BZOJ4199][Noi2015]品酒大会(后缀数组+并查集)