PopWindow解决Android7.0调用showAsDropDown方法失效问题

PopWindow解决Android7.0调用showAsDropDown方法失效问题

for example
        if (Build.VERSION.SDK_INT < 24) {
            pop.showAsDropDown(view);
        } else {
            // 适配 android 7.0
            int[] location = ViewUtil.getViewPositionByScreen(view);
            int x = location[0];
            int y = location[1];
            pop.showAtLocation(view, Gravity.NO_GRAVITY, 0, y + view.getHeight());
        }

你可能感兴趣的:(PopWindow解决Android7.0调用showAsDropDown方法失效问题)