After commenting out iphone::KeyboardOnScreen::Init(); in http://appController.mm to ensure that I am able to receive autorotation events, I am trying to add a UIView to the Unity's window in the appController:
-(void) applicationDidFinishLaunching:(UIApplication*)application{
printf_console("-> applicationDidFinishLaunching()\n");UIWindow *topWindow = [[UIApplication sharedApplication]keyWindow];
menuVC = [[MenuTestViewController alloc] initWithNibName:@"MenuTestViewController" bundle:nil];
menuVC.view.frame = CGRectMake(0,0,200,1024);
[topWindow addSubview:menuVC.view];
When I run it, my menuVC.view fills the entire view, and through NSLogs I see that after
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
NSLog(@"MenuTestViewController.shouldAutorotateToInterfaceOrientation");
// Overriden to allow any orientation.
if((interfaceOrientation == UIDeviceOrientationLandscapeLeft) || (interfaceOrientation == UIDeviceOrientationLandscapeRight)){
return YES;
}else{
return NO;
}
}
The bounds and frame of menuVC.view are reset to 1024x768. I gave up on it for awhile but after seeing rolls royce's Phantom iPad application execute it properly, I'm more determined than ever. Thoughts?
asked
Nov 22 '10 at 03:01 PM
RCSlat88
1
●
3
●
3
●
3