popwindow显示在控件左方
2016-10-20 17:59
183 查看
需要计算弹窗左边缘离屏幕左边的距离,上边缘离屏幕上边的距离
至于在控件上方,和右边,可通过类似计算获得
至于在控件上方,和右边,可通过类似计算获得
view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED); int popupWidth = view.getMeasuredWidth(); int popupHeight = view.getMeasuredHeight(); int[] location = new int[2]; add_ibtn.getLocationOnScreen(location); pop.showAtLocation(add_ibtn, Gravity.NO_GRAVITY, location[0] - popupWidth, location[1] + add_ibtn.getHeight() / 2 - popupHeight / 2);
相关文章推荐
- 解决android7.0 popwindow设置showAsDropdown不显示在控件下方的问题
- POPwindow显示可从上往下拉的仿抽屉式控件
- 设置PopWindow显示在某控件之上和无法获取PopWindow高度问题解决方法
- setAnimationStyle实现的popwindow显示消失的动画效果
- 仿QQ好友动态添加说说、图片菜单滑动移进移出效果--在指定控件下面显示popupwindow动画不移效果
- PopupWindow显示在某个控件上方
- android popwindow类似QQ中控件
- popwindow动画显示消失,activity切换动画
- Android中PopupWindow显示在控件的左边
- popwindow在View的上,下,左,右 显示
- 封装一个Win32弹出提示框的函数(用于Window控件 显示Tooltip)
- coolite Ajax方式无法显示Window控件问题解决方法
- 在Activity中弹出popwindow,再点击popwindow里面的控件弹出另一个popwindow时报错
- Android自定义PopupWindow显示在控件上方或者下方
- popwindow中放gridview带有item依次显示动画效果
- PopWindow放到具体控件的某一位置。
- popwindow显示位置
- setAnimationStyle实现的popwindow显示消失的动画效果
- popwindow动画显示消失,activity切换动画
- 用setAnimationStyle来设置popwindow显示消失的动画效果