##TextScroller
A text scroller View (scrolls left or right horizontally) .
This is a UIView
that holds a UILabel
in it. The text of the UILabel
is scrolled. Three types of scrolling types are available at the moment.
- Right to Left
- Left to Right
- Floating
This git package contains an example Xcode project. Executing which you would get a screen shot like below.
###Usage
Just copy the following files and put them inside your project.
SPTextScrollerView.h
SPTextScrollerView.m
Add QuartzCore.Framework
into your project
- Initiate
Init with UILabel
- (id)initWithUILabel:(UILabel *)label;
Init With your frame
and text
- (id)initWithFrame:(CGRect)frame Text:(NSString*)text Font:(UIFont*)font ScrollType:(ScrollerType)scrollType;
-
Configurable Parameters
CGFloat speed; // Scrolls pixels per unit time, 5.0 by default UIColor *textColor; // gray by default UIFont *textFont; NSString *text; ScrollerType textScrollerType;
-
Helper Methods
- (void) startScrolling; // Start Scrolling - (void) stopScrolling; // Pause Scrolling
-
Scroller types
typedef enum { ScrollerTypeRightToLeft = 0, ScrollerTypeLeftToRight = 1, ScrollerTypeFloating = 2, ScrollerTypeUnknown = -1 }ScrollerType;
Follow me @freesuraj on Twitter for the latest news.