Google Ads MediaView not correctly resizing height to wrap_content when displaying image

后端 未结 5 435
情歌与酒
情歌与酒 2020-12-31 04:54

I got an email from AdMob today saying:

Change to native ads policy: Native ads will require MediaView to render the video or main image asset. In a

5条回答
  •  执笔经年
    2020-12-31 05:09

    for (int i = 0; i < mediaView.getChildCount(); i++) {
        View view = mediaView.getChildAt(i);
        if (view instanceof ImageView) {
            ((ImageView) view).setAdjustViewBounds(true);
        }
    }
    

    This works for me.I tried Richard's answer,But it didn't works well in a RecyclerView.

提交回复
热议问题