所以看起来我第一次将UIVIewController推送到我的UINavigationController堆栈时调用了这个方法:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
但这种方法不是:
-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
现在,如果我在加载UIViewContoller后旋转设备,则会按预期触发这两个设备。
为什么在我的控制器加载时没有调用didRotateFromInterfaceOrientation
?
答案 0 :(得分:0)
来自UIViewController Class Reference:
didRotateFromInterfaceOrientation:
用户界面旋转后发送到视图控制器。
didRotateFromInterfaceOrientation
在加载期间未被调用,因为没有用户界面轮换。
shouldAutorotateToInterfaceOrientation
。我不确定为什么在加载过程中调用它。我认为这可能是UINavigationViewController
使用的某些性能优化提示的问题。