我有这个UILabel动画,动画倒计时器.它工作正常,但......
现在,它的设置使文本从顶部缓和使用CATransition kCATransitionFromBottom.这需要0.5秒.如何才能使它在接下来的0.5秒内,CATransition我的标签缓和到底部?
希望你能理解!谢谢!
这是一个关于动画现在如何看的视频:http://tinypic.com/r/5vst2h/8
-(void)updateLabel {
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
int *units = NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
NSDateComponents *components = [calendar components:units fromDate:[NSDate date] toDate:destinationDate options:0];
//ANIMASJON
secLabel.alpha = 0;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
//don't forget to add delegate.....
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
secLabel.alpha = 1;
//also call this before commit animations......
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
CATransition *animation = [CATransition animation];
animation.duration = 0.5; //You can …Run Code Online (Sandbox Code Playgroud)