2012-04-25 48 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