window的showAsDropDown失效的问题
来源:互联网 发布:安装数据库失败日志 编辑:程序博客网 时间:2024/06/05 16:43
在使用Popupwindow的showAsDropDown的时候,有时候会在特定机型上无法正确显示(全屏显示了)。
目前的解决方案是如果需要全屏显示的popwindow,要计算出window的实际高度然后调用popupwindow的setHeight方法后再调用showAdDropDown即可。
获取PopupWindow的实际高度:
public static void showPopwindow(Context context, PopupWindow popupWindow, View anchor) { int[] locations = new int[2]; anchor.getLocationOnScreen(locations); int screenHeight = context.getApplicationContext().getResources().getDisplayMetrics(); int height = screenHeight - anchor.getHeight() - locations[1]; popupWindow.setHeight(height); popupWindow.showAsDropDown(anchor); }
阅读全文
0 0
- window的showAsDropDown失效的问题
- android popupwindow showAsDropDown offsetx无效的问题
- PopupWindow的showAsDropDown位置问题 Android7.0
- IE6的window.location.href失效问题
- 关于requestWindowFeature(Window.Feature_no_Title);失效的问题
- [问题解决]Android7.0上PopupWindow的showAsDropDown位置问题
- Android7.0中PopupWindow的showAsDropDown异常问题
- Android7.0上PopupWindow的showAsDropDown位置问题
- 解决android 7.0 popwindow的showAsDropDown没有效果问题
- Android7.0上PopupWindow的showAsDropDown位置问题
- Android7.0上PopupWindow的showAsDropDown位置问题 参数无效
- Popupwindow的showAsDropDown方法详解
- Android showAsDropDown的诡异显示
- window.location.href在IE下失效的问题
- window.close()失效问题
- android showAsDropDown的用法属性介绍
- PopupWindow的使用showAsDropDown()无法dismiss解决方法
- PopWindow的showAsDropDown在7.0手机上显示位置错乱问题
- Android中framework res项目中各个文件夹的含义和用途详解
- Prepar3d.cfg
- 前端开发者,必须知道的项目资源
- 3.1SpringBoot-JPA演示
- iOS sectionFootersPinToVisibleBounds 导致iOS9.0系统之前的用户闪退
- window的showAsDropDown失效的问题
- Java位运算在程序设计中的使用:位掩码(BitMask)
- 用管道或套接字实现客户端服务器模型
- Xamarin XAML语言教程使用Progress属性数据绑定设置进度条进度
- 技术专业名称含义
- 如何选择云服务器
- 树莓派上MJPG-streamer安装过程
- String,StringBuffer与StringBuilder的区别??
- Vuforia+unity3D=AR Demo(初级教程)