我想实现像 ECG(心跳监测器)一样的连续脉冲效果。目前我正在使用两个动画块。
[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.. 但它仍然暂停..