|
|
6 years atrás | |
|---|---|---|
| .. | ||
| TXScrollLabelView | 6 years atrás | |
| LICENSE | 6 years atrás | |
| README.md | 6 years atrás | |
TXScrollLabelView is an iOS class that displays a adverts or boardcast e.g. with an view.(中文版)
TXScrollLabelViewTypeLeftRight : scrolling from right to left, and cycle all contents(scrollTitle) in a single line.
TXScrollLabelViewTypeUpDown: scrolling from bottom to top, and cycle all contents.
TXScrollLabelViewTypeFlipRepeat: scrolling from bottom to top, and cycle the first line of your contents.
TXScrollLabelViewTypeFlipNoRepeat: scrolling from bottom to top, and cycle all contents with a line once times.
And scrollVelocity property now supports all above enum of TXScrollLabelViewType, just enjoy it!
There are two ways to use TXScrollLabelView in your project:
Using CocoaPods
By cloning the project into your repository
Using Carthage (not support now)
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects.
Podfile
platform :ios, '7.0'
pod 'TXScrollLabelView'
Drag ALL files in the TXScrollLabelView folder to project
Import the main file:
#import "TXScrollLabelView.h”
Now, TXScrollLabelView supports both array & string. just enjoy it. 👀
Objective-C :
/** Step1: 滚动文字 */
NSString *scrollTitle = @"xxxxxx";
/** Step2: 创建 ScrollLabelView */
TXScrollLabelView *scrollLabelView = [TXScrollLabelView scrollWithTitle:scrollTitle type:TXScrollLabelViewTypeFlipNoRepeat velocity:velocity options:UIViewAnimationOptionCurveEaseInOut];
/** Step3: 设置代理进行回调(Optional) */
scrollLabelView.scrollLabelViewDelegate = self;
/** Step4: 布局(Required) */
scrollLabelView.frame = CGRectMake(50, 100, 300, 30);
[self.view addSubview:scrollLabelView];
/** Step5: 开始滚动(Start scrolling!) */
[scrollLabelView beginScrolling];
You can running TXScrollLabelViewDemo for more details.
Swift : Producting.(Swift-version)
Tap Gesture callback.
- (void)scrollLabelView:(TXScrollLabelView *)scrollLabelView didClickWithText:(NSString *)text atIndex:(NSInteger)index;
Absolutely,you can contribute to this project all the time if you want to.
If you need help or ask general question, just @tingxins in Weibo or Twitter, ofcourse, you can access to my blog.
If you found a bug, just open an issue.
If you have a feature request, just open an issue.
If you want to contribute, fork this repository, and then submit a pull request.
TXScrollLabelView is available under the MIT license. See the LICENSE file for more info.