iphone - 通过触摸平滑旋转 UIView

标签 iphone objective-c iphone-sdk-3.0 uitouch cgaffinetransform

我想知道如何在我的代码中平滑 UITouch。我能够在我的 UIView 上检测到 UItouch,但是当我尝试使用 CGAffineTransform 旋转 View 时,它不会平滑旋转。对于这种旋转,我必须在 iPhone 上按下或长按手指触摸。 如何执行平滑旋转,例如 Roambi Visualizer 应用程序。 感谢您的帮助。

最佳答案

transform 是 UIView 的动画属性,因此可以使用 Core Animation 使旋转平滑:

CGAffineTransform newTransform = //...construct your desired transform here...
[UIView animateWithDuration:0.2
                 animations:^{view.transform = newTransform;}];

关于iphone - 通过触摸平滑旋转 UIView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5352255/

相关文章:

ios - 关于iPhone切换应用时更改状态栏颜色的问题

iphone - 让 UITableView 转到顶行

iOS 应用程序启动时间测量

ios - 如何为整个App设置UIKeyboard-Style?

objective-c - 在 UIBezier 路径的 addLineToPoint 之后运行动画

php - 从 Iphone 应用程序登录网络服务器?

objective-c - 以编程方式更改 UIButton 类型

iphone - iPhone 主屏幕上的徽章

iphone - 我可以将 CADisplayLink 用作 NSTimer 吗?

iphone - iPhone 上的每个构建配置文件?