2010-08-16 77 views
0

有没有办法启用旋转,但没有动画时,您将设备从纵向转为横向?有没有办法在没有动画的UIViewController中进行旋转?

我看:

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration 

...但我不知道怎样才能将“持续时间”属性设置为0,从而消除动画。也许有更好的办法?

感谢

回答

1

可以使用变换一个UIView的财产立即旋转视图:

CGAffineTransform trans = CGAffineTransformMakeRotation(180.0); 
yourView.transform = trans; 

希望这将有助于。

更多信息可用here

相关问题