【发布时间】:2013-01-12 18:00:47
【问题描述】:
我在导航控制器中嵌入了一个视图层次结构。当视图旋转时,子视图控制器中会调用哪些方法?这段代码在导航控制器的一个子视图中,这些方法都没有被调用!
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
NSLog(@"1");
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
return true;
}else{
if(toInterfaceOrientation == UIInterfaceOrientationPortrait){
return YES;
}
}
return false;
}
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
[self loadCorrectElements];
NSLog(@"2");
}
谢谢!
【问题讨论】:
标签: iphone ios ipad uinavigationcontroller rotation