标签:class rri window atl int code pop was location
重写方法:
@Override public void showAsDropDown(View anchorView, int xoff, int yoff) { if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N) { int[] a = new int[2]; anchorView.getLocationInWindow(a); showAtLocation(anchorView, Gravity.NO_GRAVITY, xoff, a[1] + anchorView.getHeight() + yoff); } else { super.showAsDropDown(anchorView, xoff, yoff); } } @Override public void showAsDropDown(View anchorView) { if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N) { int[] a = new int[2]; anchorView.getLocationInWindow(a); showAtLocation(anchorView, Gravity.NO_GRAVITY, 0, a[1] + anchorView.getHeight()); } else { super.showAsDropDown(anchorView); } }
标签:class rri window atl int code pop was location
原文地址:http://www.cnblogs.com/yaya25001/p/7680235.html