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

相关文章:

  • 2021-12-30
  • 2021-10-16
  • 2021-07-07
  • 2021-11-01
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2021-12-25
  • 2021-08-09
  • 2021-04-02
  • 2021-09-08
  • 2021-08-08
  • 2021-07-27
相关资源
相似解决方案