在UIApplication中是否有像beginIgnoringInteractionEvents這樣的函數會忽略旋轉而不是觸摸?我需要我的應用程序不要在我出示的MPMovePlayerViewController
中旋轉。系統忽略iPhone旋轉
感謝
[更新]
這裏是我的代碼 -
MPMoviePlayerViewController *mpViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:videoURL]];
[mpViewController shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
[self presentMoviePlayerViewControllerAnimated:mpViewController];
[mpViewController release];
我把它加入兩個shouldAutorotateToInterfaceOrientation工作:和setStatusBarOrientation:方法。它在模擬器中工作。但是,如果我在播放視頻的同時旋轉iPhone,狀態欄也會旋轉,並保持豎屏方向。在http://i28.tinypic.com/357mrub.png
[UPDATE 2]
通過繼承MPMoviePlayerViewController(和實施shouldAutorotate方法)我的問題的
圖像,程序轉動,它應。只有視頻不播放,因爲該行
[self presentMoviePlayerViewControllerAnimated:mpViewController];
不接受我的子類。
「警告:不相容的Objective-C類型 '結構NoRotate *',預期 '結構MPMoviePlayerViewController *' 時傳遞參數1 'presentMoviePlayerViewControllerAnimated:' 從不同目標C型」
它終於成功了!謝謝 – jmont 2010-07-16 05:34:25