我有一个应用程序,我设置为仅在纵向模式下运行。
但我有一个页面视图,我正在显示一张照片,但希望启用它来自动旋转设备。我尝试将这些代码放入其中但
-(NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
-(BOOL)shouldAutorotate {
return YES;
}
有人可以告诉我们现在需要做什么吗?
答案 0 :(得分:-1)
您必须在imageview上设置旋转点
UIImageView *yourImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.png"]];
yourImageView.center = CGPointMake(100.0, 100.0);
yourImageView.transform = CGAffineTransformMakeRotation(M_PI_2);