美文网首页
popupWindow 修复Android 24以上的定位锚点问

popupWindow 修复Android 24以上的定位锚点问

作者: 手微凉_ | 来源:发表于2017-11-02 15:58 被阅读0次

//重写showAsDropDown方法

@Override

public void showAsDropDown(View anchor) {

if(Build.VERSION.SDK_INT>=24) {

Rect visibleFrame =newRect();

anchor.getGlobalVisibleRect(visibleFrame);

intheight = anchor.getResources().getDisplayMetrics().heightPixels- visibleFrame.bottom;

setHeight(height);

}

super.showAsDropDown(anchor);

}

相关文章

网友评论

      本文标题:popupWindow 修复Android 24以上的定位锚点问

      本文链接:https://www.haomeiwen.com/subject/ogtapxtx.html