When orientation changes occur and view controllers are subsequently notified of changes, does the entire of the root view and all its subviews receive these notifications? I have created a root view and a subview to that root view. Does the subview's controller (and any controllers of subviews in this hierarchy) receive all the rotation handling resulting from device orientation changes?
I ask because nested in this hierarchy is a UISplitViewController's view, and I suspect it is not receiving notification of device orientation changes. i.e. I essentially have something like A -> B -> C in my view hierarchy where C is a开发者_如何转开发 UISplitViewController's view.
When orientation changes occur only the first view of the window will rotate together with its entire hierarchy. In terms of viewControllers, the first view's viewController will get the orientation change events (and viewWill/DidAppear events) and all the viewControllers spawn by it. By spawn I mean a viewcontroller displayed using either as a tab of a uitabbarViewController, or added to a navigation controller, or displayed modally. In other words if somewhere in your hierarchy you added a viewcontroller's view manually to the window or another view, that viewcontroller will not get any events.
See this: why does viewDidAppear not get triggered? same thing happens for orientations changes
So there are 2 possible causes:
- your uisplitviewController's view or any of its parent is added manually to the view hierarchy instead of pushing the viewcontroller (the view gets rotated but does not receive events)
- you added the view as a second child of the window (the view doesn't get rotated at all)
精彩评论