`

iphone 的滚动文字条(俗称跑马灯)

    博客分类:
  • ios
阅读更多

转自: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];

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics