Reputation: 3357
I have enabled banner ads via self.canDisplayBannerAds = YES;
on a modal view within my app. The banner shows at the bottom of the screen just below a toolbar. When starting the app in portrait mode and moving to this VC, the ads look correct. When on this VC if I rotate to landscape mode the view also resizes correctly and all is well. However, if I start the app in landscape mode and then navigate to this VC, the toolbar is not displayed correctly. The buttons are forced down partially off the screen even before the iAD starts. Once the iAD starts the bar does move up; however, the buttons are still incorrectly located.
If I disable ads and start the app in landscape mode the toolbar is fine so I am sure this is due to the ad. I am thinking it is screwed up on the orientation since this command is called in ViewDidLoad but I cannot call it afterwards or the entire placement gets totally screwed up.
How can I get the iAd to place itself correctly when starting in landscape mode?
Upvotes: 0
Views: 175
Reputation: 3357
So to fix this issue I had to add another constraint on the y-axis. I had a constraint prior to the bottom of the view but by adding another y constraint at the top of the toolbar (its nearest neighbor is a scrollview) the issue was resolved. Not sure why it worked without that constraint in all other scenarios, but this did resolve the issue.
Upvotes: 0