想要popWindows正常在Android7.0系统正常显示,我们需要重写popWindows的showAsDropDown方法:
public class PopWindowSelectCondition extends PopupWindow {....代码省略....@Overridepublic void showAsDropDown(View anchor) {if (Build.VERSION.SDK_INT >= 24) {Rect rect = new Rect();anchor.getGlobalVisibleRect(rect);int h = anchor.getResources().getDisplayMetrics().heightPixels - rect.bottom;setHeight(h);}super.showAsDropDown(anchor);}....代码省略....
}