0
我有一個TabBar應用程序,我想保留在肖像模式,但通過UIWebView流視頻時,我想添加支持旋轉到橫向爲了全屏。這可能嗎?我的應用程序的佈局在風景上看起來不太吸引人,因此希望保持縱向模式。但如果你不能全屏顯示,那麼以縱向模式觀看視頻根本沒有吸引力。iPhone應用程序主視圖不旋轉,但需要旋轉的時候調用UIWebView?
TIA
我有一個TabBar應用程序,我想保留在肖像模式,但通過UIWebView流視頻時,我想添加支持旋轉到橫向爲了全屏。這可能嗎?我的應用程序的佈局在風景上看起來不太吸引人,因此希望保持縱向模式。但如果你不能全屏顯示,那麼以縱向模式觀看視頻根本沒有吸引力。iPhone應用程序主視圖不旋轉,但需要旋轉的時候調用UIWebView?
TIA
你可以做這樣的事情。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
if (_isPlaying) return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
if (_isPlaying && UIInterfaceOrientationIsLandscape(toInterfaceOrientation)){
// Hide tabBar Or Go fullscreen
}
else {
// show tabBar
}
}
感謝您的快速回復@NJones。我的rootController是我的TabBarViewController,方向由應用程序委託處理。我的第一個標籤或應用程序中的視圖有幾個按鈕時按下將啓動MPMoviePlayerController。我有點困惑如何處理moviePlayerController的方向和/或通過應用程序委託使用UIWebView。 – tg2007