shouldAutorotateToInterfaceOrientation单视图

时间:2012-07-25 02:44:35

标签: objective-c

如何设置单个视图应该执行哪些方向? 下面的这个工作给了我所有的方向,但在特定的视图中,我不想旋转。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
 return YES;
}

谢谢!

1 个答案:

答案 0 :(得分:1)

这样做:

- (BOOL)shouldAutorotateToInterfaceOrientation:   (UIInterfaceOrientation)interfaceOrientation
{
     //Or UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight
     return (interfaceOrientation == UIInterfaceOrientationPortrait);
}