在我的视图控制器中,我已实现此功能:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
但我的viewcontroller没有切换方向。我错过了什么?感谢
答案 0 :(得分:0)
我这样做:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (interfaceOrientation == UIDeviceOrientationLandscapeLeft || interfaceOrientation == UIDeviceOrientationLandscapeRight)
{
return YES;
}
return NO;
}
这基本上就是你在做什么。确保InterfaceBuilder也可以在横向模式下查看您的视图。