iosuiviewcontrolleradmobuiwindowadbannerview

iOS: Admob smart banner does not taking full width


I created banner:

    bannerView = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait)  
    bannerView.adUnitID = "ca-76543456707"
    bannerView.delegate = self

it should be full width and I add it to the view with leading, tralling, top and bottom constraints. For most of all ads the result is with a full width. But for some is not. Why? Here is a sample: enter image description here Red here is color of view.

How to make it full width?


Solution

  • Typically, Smart Banners on phones have a height of 50dp in portrait and 32dp in landscape. On tablets, height is normally 90dp in both orientations.

    When an image ad isn't large enough to take up the entire allotted space, the image will be centered, and the space on either side will be filled in.

    enter image description here

    You can also check live apps on AppStore, you will notice on larger width device that they also display 320 width.