在MainViewController中,我必须在方向更改时调整一些图像.简单 - 只需将代码添加到willAnimateRotationToInterfaceOrientation: callback
- (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration {
NSLog(@"orientation: %@", name(orientation));
..
Run Code Online (Sandbox Code Playgroud)
按预期工作.在Portrait中,我将另一个方向感知UIViewController推送到UINavigationController上.我转向风景,一切都很好.
然后我通过调用返回MainViewController
[self.navigationController popViewControllerAnimated:YES];
Run Code Online (Sandbox Code Playgroud)
当MainViewController的子视图根据autoresize蒙版调整为Landscape时,willAnimateRotationToInterfaceOrientation:不会被调用!
我本来期望willAnimateRotationToInterfaceOrientation:要么在不在导航控制器堆栈之上时调用,要么在返回到堆栈顶部时至少被调用.
我假设我可以手动调用willAnimateRotationToInterfaceOrientation:在pop之前但感觉不对.
我错过了什么?