UIView转场动画

     // MARK: - UIView动画-过度动画
     var redView:UIView?
     var blueView:UIView?

 //    enum UIViewAnimationTransition : Int {
 //
 //        case None
 //        case FlipFromLeft
 //        case FlipFromRight
 //        case CurlUp
 //        case CurlDown
 //    }

     //上翻页
     @IBAction func excessiveAnimationRed()
     {
         UIView.beginAnimations(nil, context: nil)
         UIView.setAnimationDuration(1.0)//设置动画时间
         UIView.setAnimationTransition(UIViewAnimationTransition.CurlUp, forView: self.view, cache: true)
         self.view.exchangeSubviewAtIndex(, withSubviewAtIndex: )
         UIView.commitAnimations()
     }

     //下翻页
     @IBAction func excessiveAnimationBlue()
     {
         UIView.beginAnimations(nil, context: nil)
         UIView.setAnimationDuration(1.0)//设置动画时间
         UIView.setAnimationTransition(UIViewAnimationTransition.CurlDown, forView: self.view, cache: true)
         self.view.exchangeSubviewAtIndex(, withSubviewAtIndex: )
         UIView.commitAnimations()
     }

     // MARK: - UIView动画-翻转
     @IBAction func flipAnimation()
     {
         UIView.beginAnimations(nil, context: nil)
         UIView.setAnimationDuration(1.0)//设置动画时间
         UIView.setAnimationTransition(UIViewAnimationTransition.FlipFromLeft, forView: testImageView, cache: true)
 //        UIView.setAnimationTransition(UIViewAnimationTransition.FlipFromRight, forView: testImageView, cache: true)
         UIView.commitAnimations()
     }
 创建两个视图
         //过度动画 添加两个视图
         redView = UIView(frame: CGRectMake(, , , ))
         redView?.backgroundColor = UIColor.redColor()
         self.view.insertSubview(redView!, atIndex: )

         blueView = UIView(frame: CGRectMake(, , , ))
         blueView?.backgroundColor = UIColor.blueColor()
         self.view.insertSubview(blueView!, atIndex: )
 

最新文章

  1. imx6 DDR_Stress_Test
  2. 黄聪:深入理解PHP Opcode缓存原理
  3. android104 帧动画,补间动画,属性动画
  4. 给iOS开发者的GCD用户手册
  5. ASP.NET 实现上一篇文章 下一篇文章
  6. python基础:各种类型的转换
  7. Web Worker Best Practices
  8. Python 锁 同步 互斥锁
  9. xcode 8 清除无用的打印
  10. Symbol Table Applications
  11. Java NIO ServerSocketChannel
  12. 20145104张家明 《Java程序设计》第7周学习总结
  13. 直接修改class文件内容即使是文本会导致App异常,正确方式是修改java再用生成的class替换掉原有的class
  14. 《快学Scala》第一章 基础
  15. Java的IO流各个类的使用原则
  16. selenium 对浏览器的操控 java
  17. 匈牙利游戏(codevs 1269)
  18. SOLID总结(未完待续)
  19. android中ListView的定位:使用setSelectionFromTop
  20. python--8、socket网络编程

热门文章

  1. stl 中List vector deque区别
  2. 棒棒的毛笔字PS教程
  3. Bluebird-Core API(二)
  4. Yii 1 数据库操作 笔记
  5. linux安装lua相关编译报错
  6. UVALive 5880 Vigenère Cipher Encryption (模拟)
  7. invoking gdb
  8. spring 的properties解析
  9. How Tomcat Works(十五)
  10. kindeditor html代码过滤不能保存