xcode - 随着时间的推移增加图像尺寸?

标签 xcode swift

我有一张图像需要随着时间的推移而增加尺寸。我该如何去做呢?

var timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: Selector("grow"), userInfo: nil, repeats: true)

对于实际的功能,我很困惑如何编写它。

最佳答案

如果您想要流畅的动画,请使用此:

UIView.animateWithDuration(0.4, animations: { () -> Void in
    imageView.transform = CGAffineTransformMakeScale(2.0, 2.0)
})

关于xcode - 随着时间的推移增加图像尺寸?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29319940/

相关文章:

ios - swift 图片从URL下载到本地存储

iOS SideMenu v3.1.4 乱序调用生命周期方法

ios - 将数据保存在钥匙串(keychain)中,只能通过 Swift 3 中的 Touch ID 访问

ios - App Store Connect操作错误: Missing CFBundleIdentifier in path

ios - Xcode 中的本地化按钮有什么作用?

c++ - 如何让 XCode 6 在调用 Debugger() 时不停止执行?

ios - 程序化 UINavigationController 和 segue 离开

swift - 单元格中的 TextView 具有自动大小

使用 emscripten 编译 Xcode 项目

ios - 只能有一个 UIMenuController 实例