Hi,
Thank you for reaching out to us regarding this.
I made modifications with
our sample app to test your scenario and set a light green background to the MediaView to see the behavior visually and below are my findings.
- When I set the MediaView's width to match_parent and its height to wrap_content, the Ad itself occupied the full width space of the MediaView, however, I can see that there is a proportional amount of blank space above and below the Ad as you can see in the attached screenshot (mediaview.png). Nevertheless, the set width for the MediaView itself is still followed.
- I also tested playing around different values for the height (150 dp with width set to match_parent) of the MediaView and I can see that the Ad itself adjusted accordingly to leave a proportional space outside the ad but still within the MediaView. The set width for the MediaView itself is still followed.
Given these information, the width set for the MediaView is followed, however, the Ad itself (which is provided from the server) seems to follow an aspect ratio (to maintain the visual quality of the image) that results to the proportional spaces outside the ad. The spaces gives the impression that the MediaView is not following the width set but in fact the space are part of the MediaView's content.
For testing purposes, could you try setting a light background to your MediaView and see if it does follow the width set on your end? Feel free to test it with our sample app as well.
Regards,
Ivan Bautista
Mobile Ads SDK Team