code_junkie

Resizable UILabel which scrolls across the screen

Nov 13th, 2011
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. [lblMessage setText: txtEnter.text];
  2.  
  3. CABasicAnimation *scrollText;
  4.  
  5. scrollText=[CABasicAnimation animationWithKeyPath:@"position.x"];
  6. scrollText.duration = 3.0;
  7. scrollText.repeatCount = 10000;
  8. scrollText.autoreverses = NO;
  9. scrollText.fromValue = [NSNumber numberWithFloat:500];
  10. scrollText.toValue = [NSNumber numberWithFloat:-120.0];
  11.  
  12. [[lblMessage layer] addAnimation:scrollText forKey:@"scrollTextKey"];
  13.  
  14. [lblMessage setText: txtEnter.text];
  15. [lblMessage sizeToFit];
  16. scrollView.contentSize = lblMessage.frame.size;
Add Comment
Please, Sign In to add comment