美文网首页
PopWindow解决Android7.0调用showAsDro

PopWindow解决Android7.0调用showAsDro

作者: middle2021 | 来源:发表于2017-01-04 16:03 被阅读208次
    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调用showAsDro

          本文链接:https://www.haomeiwen.com/subject/broovttx.html