【发布时间】:2017-07-05 07:05:03
【问题描述】:
目标:
如何为我想要展开以填满整个屏幕的UIView 设置动画。 UIView 需要在动画时以平滑、均匀和平衡的方式展开。
我在屏幕上放置了一个红色方块,从小开始,然后扩展以适应屏幕。 (图 1。)
let subview = UIView()
subview.backgroundColor = .red
subview.frame = CGRect(x: 60, y: 200, width: 50, height: 50)
self.view.addSubview(subview)
问题:
在 Swift 2 和 Swift 3 中,使用
animateWithDuration,我该怎么做 动画红色方块UIView以平衡且均匀的方式扩展 以四面八方的方式填满整个屏幕?UIView.animateWithDuration(1.0, delay: 0, options: nil, animations: { ????? }, completion: nil)
图片 1:
【问题讨论】:
标签: ios swift animation uiview animatewithduration