popwindow showAsDropDown 在7.0手机上无效果

当手机安卓系统为7.0时,showAsDropDown()不起效果,我们可以用showAtLocation来解决这个问题

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            mPopupWindow.showAtLocation(mToolbar, Gravity.NO_GRAVITY, 0, mToolbar.getHeight());
        } else {
            mPopupWindow.showAsDropDown(mToolbar);
        }

你可能感兴趣的:(popwindow showAsDropDown 在7.0手机上无效果)