It seems that if a modal view's parent returns false to shouldAutoRotate... the modal view will also not autorotate. How can I have a main view which will never rotate, and a modal view which will always rotate?
+1
A:
You may try to observe for orientation events (UIDeviceOrientationDidChangeNotification) in your modal view controller and then add a transformation to your view layer using the CATransform3DMakeRotation to get an appropriate rotation around Z or basically with
[myLayer setValue:[NSNumber numberWithInt:M_PI*0.5f] forKeyPath:@"transform.rotation.z"]; // or - M_PI*0.5f depending orientation: left or right
You can also use an animation to get an animated rotation. Is it what you're asking for?
For observing orientation events read this chapter : Getting the Current Device Orientation
For Layer transform read this chapter : Layer Geometry and Transforms
Regards.
V.Zgueb
Vincent Zgueb
2010-04-01 13:20:56