Opening AFOpenFlowView already in landscape mode
I'm using the open source CoverFlow replacement from here: http://fajkowski.com/blog/2009/08/02/openflow-a-coverflow-api-replacement-for-the-iphone/
When I detect that a certain view has gone from portrait to landscape mode, I instantiate an AFCoverFlowView and push it onto the navigation stack.
If I do so in response to
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
The cover flow view comes up as though the phone were still in portrait mode.
If I push the view in response to
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
it works perfectly - the view comes up in landscap开发者_如何学编程e mode with the phone in landscape mode
Unfortunately, the device doesn't reliable get willRotateToInterfaceOrientation messages. I have tried making sure that
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
is in loadView but that doesn't help with the notificiations.
So, my questions are:
- Is there a way to reliably get willRotateToInterfactOrientation?
if not
- How do I instruct AFCoverFlowView to come up in landscape mode (if the device is already in landscape mode)
I did a transformation on the flowView from the controller class like this:
CGAffineTransform transform = self.view.transform;
transform = CGAffineTransformRotate(transform, (M_PI / 2.0));
self.view.transform = transform;
Which worked well enough for my purposes.
精彩评论