Rect rect = new Rect();
anchor.getGlobalVisibleRect(rect);
int h = anchor.getResources().getDisplayMetrics().heightPixels - rect.bottom;
setHeight(h);
Rect rect = new Rect();
anchor.getGlobalVisibleRect(rect);
int h = anchor.getResources().getDisplayMetrics().heightPixels - rect.bottom;
setHeight(h);
问题说明
我的popupWindow是用来展示listView的,近期在Android7.0手机上测试发现showAsDropDown(view)
展示时发现会充满屏幕,而不是展示在view
的下方,测试发现在7.0以下和7.1系统下都没有类似问题。
问题解决
重写showAsDropDown(view)
,如下:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10