跑马灯效果

来源:互联网 发布:java求亦或 编辑:程序博客网 时间:2024/04/29 12:38
    CGRect frame = labelShow.frame;
    frame.origin.x = -180;
    labelShow.frame = frame;
    
    [UIView beginAnimations:@"testAnimation" context:NULL];
    [UIView setAnimationDuration:8.8f];  
    [UIView setAnimationCurve:UIViewAnimationCurveLinear];     
    [UIView setAnimationDelegate:self];  
    [UIView setAnimationRepeatAutoreverses:NO];    
    [UIView setAnimationRepeatCount:999999];
    
    frame = labelShow.frame;
    frame.origin.x = 350;
    labelShow.frame = frame;
    [UIView commitAnimations]; 

原创粉丝点击