【问题标题】:How do I spin a UIImage or UIImageView? [duplicate]如何旋转 UIImage 或 UIImageView? [复制]
【发布时间】:2011-12-15 01:57:10
【问题描述】:

可能重复:
rotate a UIView around its center but several times
How do you rotate a UIImage 360˚

我只是想让图像像风车一样旋转。我对 CGAffineTransformRotate 或 CGAffineTransformMakeRotation 的尝试似乎顺时针旋转 UIImageView 并结束。

我只是在寻找顺时针旋转。

我已将图像“分配”给 UIImage,然后使 UIImageView.Image 等于 UIImage。

然后我使用:

mySpinningImage.transform = CGAffineTransformRotate(mySpinningImage.transform,M_PI);

试图让图像顺时针流畅地旋转,但徒劳无功。

帮助...

【问题讨论】:

  • 您是否同时对视图进行任何其他修改?根据我的经验,这总是让事情变得一团糟。
  • (基本上,将其分成2个90°的旋转或使用Core Animation。)
  • JoePasq...是的..我试图让它“膨胀”:theFrame.size.width = 250 * incrementStep; theFrame.size.height = 250 * 增量步长;这是一个循环

标签: iphone objective-c xcode


【解决方案1】:

看看本教程的最后一个例子(removeWithSinkAnimation 方法),我可以帮助你:basic animation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多