【问题标题】:iOS - How to make rotation on the center of image when orientation changediOS - 如何在方向改变时在图像中心进行旋转
【发布时间】:2013-05-16 07:23:50
【问题描述】:

在 Apple Photos App 中,当它从纵向旋转到横向时。图像将在其中心点旋转。但是,我自己创建的照片应用程序并没有在中心点上旋转。

结构是这样的..

当它旋转到横向时..它将如下所示

然后我将在

中平铺页面(ImageScrollView)
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation

有没有人知道如何让它在屏幕中心旋转?

【问题讨论】:

  • 它不会自动旋转图像。你得自己做。更改scrollView的框架大小,它的ContentSize,然后相应地设置你的imageViews的框架
  • 我建议你先看这篇文章:techotopia.com/index.php/…

标签: ios orientation screen-rotation


【解决方案1】:

Ushan87 谢谢..

找到答案.. 设置图像帧必须在

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

视图将在其中心旋转

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-18
    • 2016-08-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多