2017-03-10 9 views

答えて

-1

私はそれを得ました!あなたは

...制約を入れて、これをしなければならない場合アニメイト{ ivImageLoadingInside.frame = CGRect(X:0から160、Y:123、幅:160、高さ:12)

 UIView.animate(withDuration: 1.2, delay: 0, options: .repeat, animations: { 
      self.ivImageLoadingInside.frame = CGRect(x: ScreenSize.SCREEN_WIDTH, y: 123, width: 160, height: 12) 

     }, completion: nil) 
    } else { 
     ivImageLoadingInside.layer.removeAllAnimations() 
    }* 

このリンクをご覧くださいhttp://mathewsanders.com/prototyping-iOS-iPhone-iPad-animations-in-swift/

0
self.ivImageLoadingInside.center = CGPoint(x: 80 - self.ivImageLoadingInside.bounds.width/2, y: 0) 
+0

助けてくれてありがとう! –

2
private func animation(viewAnimation: UIView) { 
    UIView.animate(withDuration: 2, animations: { 
     viewAnimation.frame.origin.x = +viewAnimation.frame.width 
    }) { (_) in 
     UIView.animate(withDuration: 2, delay: 1, options: [.curveEaseIn], animations: { 
      viewAnimation.frame.origin.x -= viewAnimation.frame.width 
     }) 

    } 
} 
関連する問題