Closed dreamstartLZ closed 1 year ago
不知道是什么原因导致 android获取到的广告宽高非常小 我只能暂时这样修改使用
/** * 重新计算真实的广告 View 的宽高 */ private void resizeAdView() { this.fad.measure(100, 100); int mw = this.fad.getMeasuredWidth(); int mh = this.fad.getMeasuredHeight(); //修改 mw = activity.getResources().getDisplayMetrics().widthPixels; mh = (mw / 4) * 3; Log.d(TAG, "resizeAdView width:" + mw + " height:" + mh); FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(mw,mh); frameLayout.setLayoutParams(params); frameLayout.requestLayout(); setFlutterViewSize(mw,mh); }
你这个是固定 4:3 的,我是 SDK 所以需要适配所有的情况
后续会将高度自动去掉,改为固定高度的广告,使用者自行设定固定宽高
已更新 v2.6.0
不知道是什么原因导致 android获取到的广告宽高非常小 我只能暂时这样修改使用