在iOS6下,以下设备转向用的方法已废弃:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
}
iOS6使用了新的方法代替:
- (BOOL)shouldAutorotate {
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationPortrait;
}

本文介绍了iOS6中设备转向机制的变化。旧版方法如shouldAutorotateToInterfaceOrientation已被废弃,取而代之的是shouldAutorotate和supportedInterfaceOrientations等新方法。文章详细解释了这些新方法如何使用。
3300

被折叠的 条评论
为什么被折叠?



