窗口高度为奇数时,最底部1px高度忽隐忽现
Closed this issue · 7 comments
luoh1234 commented
假如窗口高度为奇数时,最底部1px高度忽隐忽现,描边1px看更明显。窗口高度刚好是偶数的时候是正常的,有动态数据时,一个笨方法是计算设置偶数高度,希望有更好的解决方法
luoh1234 commented
EasyPopup mPop = new EasyPopup(getContext())
.setContentView(view)
//是否允许点击PopupWindow之外的地方消失
.setFocusAndOutsideEnable(true)
.setWidth(width)
.setHeight(211)
.createPopup();
mPop.showAsDropDown(selfView);
你把要弹框显示的视图高度(view)设置为奇数,比如211,看底部的那1px高度会不会忽隐忽现
zyyoona7 commented
@luoh1234 是连续 dismiss/show 的时候吗?我通过日志观察高度一直是设置的宽高,没有你说的情况。
mCirclePop.setOnAttachedWindowListener(new EasyPopup.OnAttachedWindowListener() {
@Override
public void onAttachedWindow(int width, int height, EasyPopup easyPop) {
LogUtils.i("width="+width+",height="+height);
}
});
zyyoona7 commented
I/EasyPopActivity: ╔═══════════════════════════════════════════════════════════════════════════════════════════════════
I/EasyPopActivity: ║ main, onAttachedWindow(EasyPopActivity.java:147)
║ width=212,height=211
I/EasyPopActivity: ╚═══════════════════════════════════════════════════════════════════════════════════════════════════
I/EasyPopActivity: ╔═══════════════════════════════════════════════════════════════════════════════════════════════════
I/EasyPopActivity: ║ main, onAttachedWindow(EasyPopActivity.java:147)
║ width=212,height=211
I/EasyPopActivity: ╚═══════════════════════════════════════════════════════════════════════════════════════════════════
I/EasyPopActivity: ╔═══════════════════════════════════════════════════════════════════════════════════════════════════
I/EasyPopActivity: ║ main, onAttachedWindow(EasyPopActivity.java:147)
║ width=212,height=211
I/EasyPopActivity: ╚═══════════════════════════════════════════════════════════════════════════════════════════════════
luoh1234 commented
实际高度不会变,你观察一下窗口最底部视图,如果不容易看出来可以描边看一下比较明显
luoh1234 commented
机型是PS1562A ,配置很低的收银机。我刚试过手机和另一台好一点的收银机没问题,系统或硬件配置低吧我的问题可忽略