iphone 的滚动文字条(俗称跑马灯)
转自:http://www.cocoachina.com/bbs/read.php?tid=15816&page=1
?
?
[position_l sizeToFit];? ?
? ? CGRect frame = position_l.frame; ?
? ? frame.origin.x = 320; ?
? ? position_l.frame = frame; ?
?
?
? ? [UIView beginAnimations:@"testAnimation" context:NULL]; ?
? ? (frame.size.width/position_l.frame.origin.x)>1?[UIView setAnimationDuration:(frame.size.width/position_l.frame.origin.x)*8.8f]:[UIView setAnimationDuration:8.8f];
? ? [UIView setAnimationCurve:UIViewAnimationCurveLinear]; ? ?
? ? [UIView setAnimationDelegate:self]; ? ?
? ? [UIView setAnimationRepeatAutoreverses:NO]; ? ?
? ? [UIView setAnimationRepeatCount:999999];? ?
?
? ? frame = position_l.frame; ?
? ? frame.origin.x = -frame.size.width;
?
? ? position_l.frame = frame; ?
? ? [UIView commitAnimations];