Use UILabel to implement text scrolling (running horse lamp) and uilabel text scrolling
-(Void) viewDidLoad {[super viewDidLoad]; // data source self. messageArray = [NSArray arrayWithObjects: @ "1", @ "2", @ "3", nil]; self. msgCount = 0; // display from the first entry}
-(Void) viewDidAppear :( BOOL) animated {// The first playback entry and add Timer to set the switching interval [self msgChange]; [nst1_scheduledtimerwithtimeinterval: 5.0f target: self selector: @ selector (msgChange) userInfo: nil repeats: YES];}
-(Void) msgChange {if (self. msgCount <self. messageArray. count) {self. scrollLabel. text = [self. messageArray objectAtIndex: self. msgCount]; self. msgCount ++;} else {self. scrollLabel. text = @ "no message"; // here, you can change the deletion to cyclic playback.} [self. scrollLabel sizeToFit]; CGRect frame = self. scrollLabel. frame; frame. origin. x = [UIScreen mainScreen]. bounds. size. width; self. scrollLabel. frame = frame; [UIView beginAnimations: @ "scrollLabelTest" context: NULL]; [UIView setAnimationDuration: 5.0f]; [UIView setAnimationCurve: Custom]; [UIView setAnimationDelegate: self]; [UIView setAnimationRepeatAutoreverses: NO]; [UIView setAnimationRepeatCount: 0]; frame = self. scrollLabel. frame; frame. origin. x =-frame. size. width; self. scrollLabel. frame = frame; [UIView commitAnimations];}