rotating layer 90° when orientation changes 180° confuses me
Hello dev colleagues,
I seem to be a little braindead at the moment. My problem is I don't understand a specific orientation change / view rotation situation.
Based on a view that has a layer (AVCaptureVideoPreviewLayer) to preview video from camera on the iPhone's screen, I want to support landscape orientation in addition to portrait orientation (standard is portrait though). So when I rotate the device from portrait to landscape, I modify the view's frame and perform a CATransform3DMakeRotation (90 degrees = 90/180*M_PI) on the preview layer. This is working well, the following procedure confuses me though:
Changing the orientation from landscape-left to landscape-right is a rotation by 180 degree, though the view controllers message willRotateToInferfaceOrientation gets called once where i rotate the preview layer by 90 degrees. In fact, the preview layer gets rotated by 180 degrees and adapts properly to the new orientation. But I only rotate by 90 degrees in code??
Anyone who can give me a hint on this?? Thanks in advance
|