views:

76

answers:

1

I am using IB to place a UIImageView (top) ADBannerView (bottom) and within the same View. When running in the Simulator, if I click on the ad, after dismissing the ad screen, the UIImageView is pushed 20px down, leaving a gap between the status bar and UIImageView.

I've tried playing with all of the AutoResizing settings in the Inspector with no luck. Strangely, other objects, like UITextViews that are superimposed over the UIImageView also shift, but respond to AutoResizing settings such that after setting the struts appropriately, the UITextViews stay in place after returning from the ad animation. ??

This issue seems to be similar to http://stackoverflow.com/questions/3032773. However, adding

self.view.frame = [[UIScreen mainScreen] applicationFrame];

to viewDidLoad is unsuccessful. (I think that's probably because in 3022773 the subview is created programmatically, whereas here its part of the nib)

Also, this post http://stackoverflow.com/questions/3166977 implies that my parent View (the view holding both UIImageView & ADBannerView) must be a "fullscreen view", but I can't figure out how that applies when using IB. (I don't see ANY settings in Inspector that allow me to tell XCode that the parent View should have that property)

Any ideas out there?

Much appreciated!

A: 

Solved.

Add

self.wantsFullScreenLayout = YES;

To your subclassed UIViewController. In this case, I added it in viewDidLoad.

Apparently, if you don't set this, it defaults to adjusting the top of the view downward to accommodate the 20px status bar.

Got this hint from http://stackoverflow.com/questions/373791

Sly