iOS 跷跷板动画 Seesaw Animation
Posted Ficow Shen
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iOS 跷跷板动画 Seesaw Animation相关的知识,希望对你有一定的参考价值。
Xcode Playgound示例代码:
let testView = UIView() testView.frame = CGRect.init(x: 100, y: 100, width: 200, height: 200) self.view.addSubview(testView) testView.backgroundColor = UIColor.red var trans = CATransform3DIdentity trans.m34 = -1.0 / 500 trans = CATransform3DRotate(trans, CGFloat.pi / 3, 1, 0, 0) UIView.animate(withDuration: 1, animations: { testView.layer.transform = trans }) { (finish) in UIView.animate(withDuration: 1, animations: { testView.layer.transform = CATransform3DIdentity }) }
Ficow原创,转载请注明出处:http://www.cnblogs.com/ficow/p/8227709.html
以上是关于iOS 跷跷板动画 Seesaw Animation的主要内容,如果未能解决你的问题,请参考以下文章