<分区>
我想在我看来永远重复一个动画。下面是我的代码:
[UIView animateWithDuration:0.5f
delay:0.49f
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
//for IMMERSE
[_pic2 setAlpha:1.0f];
_view1_immerse=_pic2.frame;
_view1_immerse.origin.x = ([UIScreen mainScreen].bounds.size.width-_view1_immerse.size.width)/2;
self.pic2.frame=_view1_immerse;
}
completion:^(BOOL finished){
[UIView animateWithDuration:0.5f delay:0.49f options:UIViewAnimationOptionCurveEaseOut animations:^{
_view1_immerse=_pic2.frame;
_view1_immerse.origin.x = [UIScreen mainScreen].bounds.size.width;
self.pic2.frame=_view1_immerse;
[_pic2 setAlpha:0.0];
} completion:^(BOOL finished){
[UIView animateWithDuration:0.0f animations:^{
_view1_immerse=_pic2.frame;
_view1_immerse.origin.x = -_view1_immerse.size.width;
self.pic2.frame=_view1_immerse;
}];
}];
}];
我尝试添加选项UIViewAnimationOptionRepeat
,但它似乎只重复了最外层的“动画”部分。我想重复整套动画。
而且我不想使用 NSTimer
。
谁能给我一些关于我的问题的建议?提前致谢!