我想要像ECG(心跳监视器)一样获得连续的脉冲效果。目前我正在使用两个动画块。UIViewAnimationOptionRepeat在两个动画之间暂停
[UIView animateWithDuration: 2.0f delay: 0.0f options: UIViewAnimationOptionRepeat | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionTransitionNone | UIViewAnimationOptionOverrideInheritedDuration
animations:^{ [image1 setFrame:CGRectMake(0,200,320,70)];}
completion:^(BOOL finished){[image1 setFrame:CGRectMake(-320,200,320,70)];}];
[UIView animateWithDuration:2.0f delay:0.0f options:UIViewAnimationOptionRepeat | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionTransitionNone | UIViewAnimationOptionOverrideInheritedDuration
animations:^{ [image2 setFrame:CGRectMake(320,200,320,70)];}
completion:^(BOOL finished){[image2 setFrame:CGRectMake(0,200,320,70)];}];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView commitAnimations];
建成后,该动画剂量重复,但它再次盯着..我想删除暂停之间,实现连续平滑的动画之前需要一点点的停顿..
任何HEP将不胜感激..
提前谢谢..
只要你知道我我也试过UIViewAnimationCurveEaseInOut ..但它仍然暂停..
第一条评论:setAnimationCurve:“如果从动画块外调用此方法,则不执行任何操作。” – meronix
second:commitAnimations如果没有开始就没有用beginAnimations:context:被调用 – meronix
@meronix:我加了setAnimationCurve:方法只是为了试验。但是在我添加该方法之前,它并没有流畅的动画效果。 –