有没有办法在视图完全加载后旋转它?

时间:2010-08-09 14:47:09

标签: iphone objective-c autorotate uiinterfaceorientation

我正在寻找一种在视图加载后旋转视图的方法,当它作为模态视图存在时。

我通过致电:

来唤起我的观点
[self presentModalViewController:cntrol animated:YES];

在那个模态视图控制器中,我正在旋转:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation {
    return  (orientation == UIInterfaceOrientationLandscapeRight);
}

1 个答案:

答案 0 :(得分:1)

您可以使用变换旋转视图。

CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159/2);
self.view.transform = transform;