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

后端 未结 5 434
情歌与酒
情歌与酒 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条回答
  •  -上瘾入骨i
    2020-12-31 05:13

    mediaView.setOnHierarchyChangeListener(new ViewGroup.OnHierarchyChangeListener() {
        @Override
        public void onChildViewAdded(View parent, View child) {
            if (child instanceof ImageView) {
                ImageView imageView = (ImageView) child;
                imageView.setAdjustViewBounds(true);
            }
        }
    
        @Override
        public void onChildViewRemoved(View parent, View child) {}
    });
    

提交回复
热议问题