iOS 动画 -- Chapter 1

2016-11-25  本文已影响24人  ted005

同时:

UIView.animate(withDuration: 0.5, delay: 0.3, options: [], animations: {
    self.username.center.x += self.view.bounds.width;
    }, completion: nil)

UIView.animate(withDuration: 0.5, delay: 0.3, options: [], animations: {
    self.password.center.x += self.view.bounds.width;
    }, completion: nil)
gif3.gif

Repeat

 UIView.animate(withDuration: 0.5, delay: 0.3, options: [.repeat], animations: {
         self.username.center.x += self.view.bounds.width;
      }, completion: nil)
gif1.gif

AutoReverse

UIView.animate(withDuration: 0.5, delay: 0.3, options: [.autoreverse], animations: {
        self.username.center.x += self.view.bounds.width;
    }, completion: nil)
gif4.gif

Include this option only in conjunction with .repeat

Repeat & AutoReverse

UIView.animate(withDuration: 0.5, delay: 0.3, options: [.repeat, .autoreverse], animations: {
        self.username.center.x += self.view.bounds.width;
    }, completion: nil)
gif2.gif
上一篇下一篇

猜你喜欢

热点阅读