0

一切工作正常,而我沒有玩任何東西(我打電話beginnotifications等,並使用方向旋轉我的看法)。但我開始與MPMoviePlayerController每次播放後,當我嘗試爲什麼在MPMoviePlayerController中播放影片時無法正確檢索UIDeviceOrientation?

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; 

orientation得到一個UIDeviceOrientationUnknown

任何線索? 當電影停止一切工作再次正常。 我需要這個方向來旋轉播放器的窗口,因爲我使用Iphone OS 3.1,所以我不能直接使用MPMovie播放器控制器內的視圖屬性。

回答

0

我還沒有找到一種方法來做到這一點,至少在iPhone操作系統版本低於3.2。我放棄。

但是,嘿,我不得不在Ipad中爲我的應用編寫一個版本,我發現對於iPhone OS 3.2,有一種方法可以實現。

你要做的唯一一件事就是使用自定義類,你必須做的MPMoviePlayerViewController兒童和覆蓋的方法shouldAutorotateToInterfaceOrientation每當你想進行自動旋轉爲yes返回。全部在MPMoviePlayerViewController類參考中。

- Zelldweller

相關問題