Hi everyone,
I'm sure this has already been discussed a few times, but I can't make it work based on what I've read so far, so I'm asking for assistance!
I would like to make a UIKit view appear when the player touches a specific SPButton on the Stage. I have designed this view and its UIViewController, and added the code to show it, using the Stage's nativeView.
Everything works fine, except that the UIView is shown in portrait mode, but my game is landscape-orientation only.
I've read somewhere on this forum that I have to use an intermediate UIView to make things work fine, but I didn't manage to do that. More specifically, I don't know how to configure this holder view so that the future views added to it will show in the right orientation.
Here's the current code that works but with the wrong orientation:
gameSettings.view.frame = CGRectOffset(gameSettings.view.frame, 0, 480); [UIView beginAnimations:@"animateSettingsWindowOn" context:NULL]; gameSettings.view.frame = CGRectOffset(gameSettings.view.frame, 0, -480); [self.nativeView addSubview:gameSettings.view]; [UIView commitAnimations];
Here's the code with a holder view, in this case nothing works (i.e. the UIView does not show):
// During init: holderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)]]; [self.nativeView addSubview:holderView]; ... // Does not work (gameSettings.view doesn't show up) gameSettings.view.frame = CGRectOffset(gameSettings.view.frame, 0, 480); [UIView beginAnimations:@"animateSettingsWindowOn" context:NULL]; gameSettings.view.frame = CGRectOffset(gameSettings.view.frame, 0, -480); [holderView addSubview:gameSettings.view]; [UIView commitAnimations];
Thank you very much!
--
Romain