Hello,
I have problems with rotating a view.
My app consists of 2 views (like the weather app) and one is always in landscape mode. So I have added the following code:
This almost always works correctly, but once in a while it won't rotate and I will get the view like in the second screenshot. (like once in 50 times or so)
When I close the app and open, it is correct again.
In the Interface Builder I have resized the window, so it is landscape and not portrait. Otherwise I couldn't add the elements in the right orientation.
Anybody know what to do here?
I have problems with rotating a view.
My app consists of 2 views (like the weather app) and one is always in landscape mode. So I have added the following code:
PHP:
MainViewController *viewController = [[MainViewController alloc] initWithNibName:@"MainView" bundle:nil];
self.mainViewController = viewController;
mainViewController.rvc = self;
// rotate view to landscape
viewController.view.transform = CGAffineTransformMakeRotation( M_PI /2);
viewController.view.center = self.view.center;
[viewController release];
infoButton.transform = CGAffineTransformMakeRotation( M_PI /2);
CGPoint point = CGPointMake(35, 445);
infoButton.center = point;
[self.view insertSubview:mainViewController.view belowSubview:infoButton];
This almost always works correctly, but once in a while it won't rotate and I will get the view like in the second screenshot. (like once in 50 times or so)
When I close the app and open, it is correct again.
In the Interface Builder I have resized the window, so it is landscape and not portrait. Otherwise I couldn't add the elements in the right orientation.
Anybody know what to do here?