Android 7.0 7.1 Popwindow显示位置异常处理方法
来源:互联网 发布:html5注册登陆源码 编辑:程序博客网 时间:2024/06/05 18:46
//显示PopWindow的方法
public void showPopWindow(View view) {
if (!isShowing()) {
this.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);
public void showPopWindow(View view) {
if (!isShowing()) {
this.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);
}
重写Popwindow后加上上面两句代码就OK了
阅读全文
0 0
- Android 7.0 7.1 Popwindow显示位置异常处理方法
- android popwindow的显示位置
- PopWindow Android 7.0 位置显示不准确解决办法
- popwindow显示位置
- PopWindow Android7.0下位置异常问题处理
- popwindow 在android 7.0位置错误
- Android N上Popwindow显示位置不正确问题
- Android N上Popwindow显示位置不正确问题
- android popwindow 位置和动画
- Android 不同版本7.0以下,7.0,7.1以上 popwindow展示位置控制分享
- android自定义PopWindow底部显示
- android自定义PopWindow底部显示
- 华为手机7.0以上华为7.0上popwindow位置显示错乱,飘
- PopWindow的showAsDropDown在7.0手机上显示位置错乱问题
- oncreate方法中显示popwindow报错
- Android Crash异常处理方法
- popwindow 在安卓7.0上显示位置错误以及在6.0下点击外部不能消失的情况解析
- Android简单PopWindow的实现方法。
- Csharp高级:进程与线程,通过递归调用找到所有文件的案例
- Hadoop伪分布式安装配置
- 【Java学习】理解try{ return } finally {} 中执行顺序
- linux命令查看文件尾部内容
- CPU中的主要寄存器
- Android 7.0 7.1 Popwindow显示位置异常处理方法
- 使用jws生成webservice 例子
- python条件语句和循环语句简介
- mac_VMware Fushion遇到“cannot find a valid peer process to connect to”时的解决办法
- 10:有一门课不及格的学生
- Shade顶点函数vert和片元函数frag
- ffplay查看运动向量及宏块的显示情况
- 续上一篇,百度TTS(网络环境下语音引擎)的优化。可以在非网络情况下使用
- 解决日期转换json 报错问题