今天在项目开发的时候遇到一个7.1系统手机适配问题,popupwindow在7.0之前直接使用showAsDropDown(View anchor, int xoff, int yoff)方法可以展示页面,但是到了7.0之后就需要使用showAtLocation(View parent, int gravity, int x, int y)方法,设置偏移高度,7.1在7.0的基础上还需通过setHeight(int height)方法,设置popupwindow在页面中所占的高度。具体代码参照http://blog.youkuaiyun.com/ithe1001/article/details/56281750
Android 7.1 PopupWindow适配问题
最新推荐文章于 2021-05-27 02:09:41 发布