views:

269

answers:

2

Hello,

I created a UIView which has two controls on it, a label and an activity indicator (spinning wheel) to display when the device is synchronizing. As this UIViewController needs to be accessed globally I'm adding it in the app's FinishedLaunching event:

window.AddSubview (navigationController.View); window.AddSubview(SyncSpinner.View); window.MakeKeyAndVisible();

I am overriding the shouldAutoRotate event and returning true to allow rotation of the view with the device. However, I have been unable to get this view to rotate. I've even tried calling teh shouldAutoRotate event from the navigationController's view shouldAutoRotate event, but it still doesn't rotate.

How do I create a very simple view to use as a status dialog with a label at the top, spinner in the middle, and have this properly rotate?

Thank you.

A: 

A similar thing happend to me. I don't know why, but the iPhone only sends the autorotate messages to the newest added view's controller.

A way around it is, to generate notifications and send them to the controller. Use this block of code in the finished launching method:

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver: viewController selector:@selector(changeOrientation:) name:UIDeviceOrientationDidChangeNotification object:nil];
tadej5553
A: 

At least with TweetStation the issue was that I needed to propagate the rotation property all the way from the first UIViewController. If the toplevel UIViewController did not support rotation, neither did the nested ones.

In TweetStation I do this with a helper top level class that runs my toplevel tabbar controller:

http://github.com/migueldeicaza/TweetStation/blob/master/TweetStation/Main.cs#L409

miguel.de.icaza