0

I have two view controller in my application. 1- TabBarController 2- Ad view Controller I added the ads just above the tab-bar so that it can be visible for all the views in the tab-bar.

Now my problem is when i add the ad view in the UIWindow then it does not rotate with the screen but full screen ad work fine (means it is shown in the current orientation of device). When i add ad in tab-bar controller view then it rotates but when user taps on ad in landscape mode. then it shows full screen ad outside the visible area of the view. Any help will be appreciated.

Rok Jarc
  • 18,765
  • 9
  • 69
  • 124
Iqbal Khan
  • 4,587
  • 8
  • 44
  • 83

3 Answers3

1

Implement view controller containment. Watch the Implementing UIViewController Containment video from WWDC 2011 to learn how to do this.

Iqbal Khan
  • 4,587
  • 8
  • 44
  • 83
0

Add it to UIViewController (in your case to TabBarController) and not directly to UIWindow. UIViewController class is responsible for handling device orientation UI changes.

Rok Jarc
  • 18,765
  • 9
  • 69
  • 124
0

UIWindow itself will not handle rotation for its subviews. However, you can add it to its first subview:

[[[window subviews] objectAtIndex:0] addSubview:adView];
fscheidl
  • 2,281
  • 3
  • 19
  • 33