开发者

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:

  1. Is there a way to reliably get willRotateToInterfactOrientation?

if not

  1. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜