PopWindow的showAsDropDown在7.0手机上显示位置错乱问题

    xiaoxiao2021-04-13  29

    只需要重写下面的方法即可:

    @Override public 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); }

    转载请注明原文地址: https://ju.6miu.com/read-668867.html

    最新回复(0)