使用以下代码什么都没有...我的视图旋转。无法理解......
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
NSLog(@"I am starting to rotate");
}
...谢谢
答案 0 :(得分:0)
这可能是由于VC嵌套在VC层次结构中的方式。
This SO帖子可以帮助你:
答案 1 :(得分:0)
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
if(self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
self.interfaceOrientation == UIInterfaceOrientationLandscapeRight){
NSLog(@"I am starting to rotate in Landscape");
} else {
NSLog(@"I am starting to rotate in Portrait");
}
}
并留下它的样子
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}