首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

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

2012-09-28 
iphone 的滚动文字条(俗称跑马灯)转自:http://www.cocoachina.com/bbs/read.php?tid15816&page1??[posit

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];

热点排行