mRadioGroup.getLocationOnScreen(location); int w = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED); int h = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED); mRadioGroup.measure(w, h); kyqNewsPopupWindow.setTvNotice("测试测试事儿成都"); kyqNewsPopupWindow.getContentView().measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); int popWidth=kyqNewsPopupWindow.getContentView().getMeasuredWidth(); int popHeight=kyqNewsPopupWindow.getContentView().getMeasuredHeight(); int height = mRadioGroup.getMeasuredHeight(); int x = getScreenWidth(getBaseContext())*5/8-popWidth/2; int y = location[1]-height-14; kyqNewsPopupWindow.showAtLocation(mRadioGroup, Gravity.NO_GRAVITY, x, y);
popupwindow设置位置
最新推荐文章于 2024-08-18 03:33:20 发布