iphoneipadiaduiinterfaceorientationadbannerview

iAd banner rotates my view to landscape


Views in my app are portrait only - my view controllers and the root view controller both ensure that they only rotate to portrait orientations using both shouldAutorotateToInterfaceOrientation: and supportedInterfaceOrientations in order to support both iOS 5 and iOS 6. I've added an iAd banner to a view, and it appears correctly at the top of the screen. When I tap it to see a test ad on the iPad, the test ad appears in lanscape, which I expect - I understand iAds may be in any orientation. But when I close the ad my views are in landscape, both the view with the banner and the view of the root view controller. They rotate back to portrait and stay there when I rotate the device.

How can I prevent iAds from rotating my view, or make my views return to portrait when the iAd closes?

Edit: I've also tried using application:supportedInterfaceOrientationsForWindow: and setting shouldAutoRotate to true - neither solves the problem.

Edit again: I've still had no luck. Here's a project with a fairly minimal view controller implementation that shows the bug I'm experiencing - any help is appreciated!


Solution

  • Solved. My secondary view controller had to be a child view controller of the main one.