如何让这个imageview
无休止地滚动,imageview
在下一个图像视图跟踪第一个视频的地方重复出现?
此代码循环使用imageview:foodbg
一次,但我希望它能无休止地循环:
// set up some constants for the animation
let duration : NSTimeInterval = 5.0
let delay : NSTimeInterval = 0.0
let options = UIViewAnimationOptions.CurveLinear
// create the background imageview and add it to the screen
let foodbg = UIImageView()
foodbg.image = UIImage(named: "foodbg5.png")
foodbg.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)
self.view.addSubview(foodbg)
var endBackgroundScroll: Bool = false
// define the animation
UIView.animateWithDuration(duration, delay: delay, options: options, animations: {
// move the background
foodbg.frame = CGRectMake(0, self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height)
}, completion: { animationFinished in
// remove the background
foodbg.removeFromSuperview()
})