Search code examples
iphoneiosopengl-esscreen-rotationtapjoy

TapJoy rotates all my UIViewContollers used inside the game


I use TapJoy SDK in my an OpenGL based game (based on Maze+ code)

when i use the following code in the App Delegate to show full screen ads

[TapjoyConnect showFeaturedAppFullScreenAd];

or even use the following code in the more games view to show more games

[TapjoyConnect showOffersWithViewController:self withInternalNavBar:NO];

i got all my View controllers (like more games view and news view) rotated see the screen shot

enter image description here

do you have any idea how to fix this problem?


Solution

  • Adding this line should fix the problem.

    [vc.view setTransform: CGAffineTransformMakeRotation(M_PI / 2)];

    It should come before this:

    vc.view.frame = view.frame;

    [view addSubview:vc.view];