Reputation: 11
I added constraints to an adbannerview so that it is locked to the top of the screen. It is also constrained to be centered horizontally. The three small constraints at the bottom are just for spacing.
For some reason the ad jumps around on the screen when I run the code in iOS simulator and on iPhones. It appears at the top of the screen occasionally but also jumps to the bottom of the screen despite constraints. I need a way to make sure it stays at the top of the screen.
This is an example of the ad in iOS Simulator.
Upvotes: 1
Views: 76
Reputation: 18908
Sounds like you're using self.canDisplayBannerAds = YES
in addition to implementing your own ADBannerView
. Using self.canDisplayBannerAds = YES
will automatically create an ADBannerView
for you and display it on the bottom of your devices screen. Remove self.canDisplayBannerAds = YES
.
Also, it looks like you have not pinned the leading and trailing space of your ADBannerView
to your view
/Superview
.
Upvotes: 1