的YouTube視頻全屏所以我有一個UIWebView中它也有一個嵌入的YouTube播放器在裏面。當我播放它,並進入全屏和旋轉,然後關閉視頻,它不會調用viewWillAppear或willRotateTo ....這是爲什麼?我需要在設備旋轉時進行一些視圖調整,但是當播放器出現時,出於某種原因,這些方法都不會被調用。是的,我有shouldAutoRotateToInterfaceOrientation正確設置。任何想法?不調用viewWillAppear中或viewWillRotate
1
A
回答
0
1
您可以使用下面爲您UIWebView的問題,viewWillAppear中或willRotateTo ..從未呼籲UIWebView的。
- (void)viewDidLoad
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayerDidExitFullscreen:)
name:@"UIMoviePlayerControllerDidExitFullscreenNotification"
object:nil];
}
- (void)viewDidUnload
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)moviePlayerDidExitFullScreen:(NSNotification *)notification
{
// This is where you do whatever you want.
}
相關問題
- 1. popviewcontroller不調用viewWillAppear中
- 2. presentModalViewController不叫viewWillRotate,didRotateToInterface
- 3. Viewwillappear調用但viewdidappear不叫
- 4. viewDidLoad中被調用,但viewWillAppear中不叫
- 5. 在ViewDidAppear或ViewWillAppear調用becomeFirstResponder()的位置?
- 6. didDeselectRowAtIndexPath在viewWillAppear在UITableViewController中不調用
- 7. viewWillAppear不會在iOS中調用
- 8. viewWillAppear中不叫
- 9. viewWillAppear中不叫
- 10. 爲什麼viewWillAppear不會被調用?
- 11. UITableViewController不能調用viewWillAppear,viewDidAppear等
- 12. viewWillAppear中或viewDidAppear上NSWindowController
- 13. UITabViewController,viewWillAppear沒有被調用?
- 14. viewWillAppear只被調用一次
- 15. viewWillAppear何時被調用?
- 16. ViewWillAppear沒有被UISplitViewController調用
- 17. viewWillAppear中不叫popToViewController
- 18. viewWillAppear中不叫modalviewwontroller
- 19. 如何避免viewWillAppear中調用最初
- 20. viewWillAppear沒有在UITableViewController中調用?
- 21. viewWillAppear沒有在BCTabBarController中調用
- 22. ViewDidAppear/viewWillAppear中沒有被調用
- 23. viewWillAppear中,viewDidAppear不會被調用,不費一槍
- 24. viewWillAppear和viewDidAppear不調用,而viewDidLoad調用什麼時在UIViewController
- 25. viewWillAppear調用但viewDidAppear不會調用後pushViewController
- 26. 在viewWillAppear中使用setNavigationBarHidden不起作用
- 27. viewWillAppear不叫
- 28. 爲什麼viewDidAppear/viewWillAppear不會在嵌套結構中調用?
- 29. viewDidAppear未調用,但viewWillAppear調用僅出現在iOS5中
- 30. 如果在「viewWillAppear」或「viewDidLoad」方法中完成,則視圖不能調整大小
你試過willAnimateRotationToInterfaceOrientation方法:你可以通過觀察@「UIMoviePlayerControllerDidExitFullscreenNotification」模式檢測的全屏模式下結束了嗎? – rishi 2012-04-26 04:49:52
這也是沒有得到所謂的 – xonegirlz 2012-04-26 05:33:11
有你在你的應用始終是設置shouldAutoRotateToInterfaceOrientation來? – rishi 2012-04-26 05:33:41