以下是Joseph Chen示例代码的更新.我还将颜色更改为绿色,因为容器默认背景为黑色:
import UIKitimport XCPlaygroundlet container = UIVIEw(frame: CGRect(x: 0.0,y: 0.0,wIDth: 100.0,height: 100.0))// XcpshowVIEw("container",vIEw: container) // -> deprecatedlet vIEw = UIVIEw(frame: CGRect(x: 0.0,wIDth: 50.0,height: 50.0))vIEw.backgroundcolor = UIcolor.greencolor()container.addSubvIEw(vIEw)UIVIEw.animateWithDuration(5) { vIEw.center = CGPoint(x: 75.0,y: 75.0)}XCPlaygroundPage.currentPage.liveVIEw=container总结
以上是内存溢出为你收集整理的iOS Playgrounds是否支持UIView动画?全部内容,希望文章能够帮你解决iOS Playgrounds是否支持UIView动画?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)