码迷,mamicode.com
首页 > 移动开发 > 详细

iOS 跷跷板动画 Seesaw Animation

时间:2018-01-07 14:14:53      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:rect   self   ati   get   init   orm   body   hdu   pos   

 

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

标签:rect   self   ati   get   init   orm   body   hdu   pos   

原文地址:https://www.cnblogs.com/ficow/p/8227709.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!