2012-04-25 31 views
0

我有一個UIWebView,有時裏面有一個YouTube視頻播放器。用戶也可以全屏查看視頻。然而問題是,當用戶全屏看到視頻,然後旋轉它,它不會調用willAnimateToInterfaceOrientation。所以我打算手動調用它。問題是,如果有人解散了YouTube視頻,我該如何進行檢查?檢查YouTube視頻從全屏解散時的狀態

回答

0

嘗試在viewDidLoad

[[NSNotificationCenter defaultCenter] addObserver:self 
       selector:@selector(didRotate:) 
       name:@"UIDeviceOrientationDidChangeNotification" object:nil]; 

- (void) didRotate:(NSNotification *)notification{ 
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; 

    //Handle rotation 

} 
註冊自己的 UIDeviceOrientationDidChangeNotification