//重写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);
}
网友评论