开发者

iPhone, playing a movie in landscape but return to portrait when movie is complete

开发者 https://www.devze.com 2023-02-15 02:23 出处:网络
Total Objective-C/XCode N00b here but I am attempting something, which I assume is simple.I have an app that is written for the iPhone, I don\'t allow auto orientation and only have the main interface

Total Objective-C/XCode N00b here but I am attempting something, which I assume is simple. I have an app that is written for the iPhone, I don't allow auto orientation and only have the main interface locked into portrait. When the user plays a video in the app I would like to allow them to auto rotate the device from portrait and watch it in landscape (should they choose to do so, I don't want to force this). Once the user presses "Done", I would like to force them back into portrait (even if they are holding the device in landscape) as the interface is only laid out in that orientation.

I've tried using the MPMoviePlayerController and MPMoviePlayerViewC开发者_开发百科ontroller and I am not sure which will give me the leverage/methods I need. I am basically just looking to allow shouldAutorotateToInterfaceOrientation to return yes only when the MPMoviePlayerController view is visible.

Any help MUCH appreciated. Thanks.


I used this code example and it worked perfectly. I think you'll have to set the orientation in the super class.

0

精彩评论

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