iAd on top of view in landscape

| | August 11, 2015

Right now I have an iAd banner on the bottom of my view when the device is in landscape. How do I get the iAd banner to be on top of the view when the device is in landscape?

banner.frame = CGRectOffset(banner.frame, -banner.frame.size.width/50, -banner.frame.size.height);

2 Responses to “iAd on top of view in landscape”

  1. You should not be setting static points for your ADBannerView. What happens when you run your application on a device that has different screen dimensions?

    What you should be doing is setting your ADBannerView‘s frame relative to the UIView it is displayed within, like so:

    iAdBannerView.frame = CGRectMake(0, 0, self.view.frame.size.width, iAdBannerView.frame.size.height);

    Read the answers to this question, UIView frame, bounds and center, for a better understanding of what frame refers to exactly.

  2. James Callyway on November 30, -0001 @ 12:00 AM
     Banner.frame = CGRectMake(0,0,480,32);

    is the solution

Leave a Reply