x


UIView as subclass of Unity's UIWindow

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?

more ▼

asked Nov 22 '10 at 03:01 PM

RCSlat88 gravatar image

RCSlat88
1 3 3 3

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x96
x4
x4

asked: Nov 22 '10 at 03:01 PM

Seen: 1353 times

Last Updated: Nov 22 '10 at 03:01 PM