Is it possible to automatically rotate a modal view, but not its parent?

It seems that if the parent of the modal view returns false in shouldAutoRotate ... the modal view will also not autorotate. How can I get a basic view that will never rotate, and a modal view that will always rotate?

+5
source share
2 answers

You can try to observe orientation events (UIDeviceOrientationDidChangeNotification) in your modular view controller and then add the transform to your view level using CATransform3DMakeRotation to get the corresponding rotation around Z or basically using

[myLayer setValue:[NSNumber numberWithInt:M_PI*0.5f] forKeyPath:@"transform.rotation.z"]; // or - M_PI*0.5f depending orientation: left or right

. , ?

:

:

.

V.Zgueb

+2

, . , , .

Modal, . .

.

0

All Articles