Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tingxins committed Nov 18, 2016
1 parent 6773465 commit 2e27612
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,58 @@
# TXScrollLabelView

[![Pod License](http://img.shields.io/cocoapods/l/SDWebImage.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![AppVeyor](https://img.shields.io/appveyor/ci/gruntjs/grunt.svg?maxAge=2592000)](https://github.com/tingxins/TXScrollLabelView)[![Pod Platform](https://img.shields.io/cocoapods/p/XHLaunchAd.svg?style=flat)](https://github.com/tingxins/TXScrollLabelView)[![Support](https://img.shields.io/badge/support-iOS%207%2B-brightgreen.svg)](https://github.com/tingxins/TXScrollLabelView)[![Pod License](http://img.shields.io/cocoapods/l/SDWebImage.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0.html)

`TXScrollLabelView` is an iOS class that displays a adverts or boardcast e.g. with an view.

![TXScrollLableView Gif](scrollLabelView.gif)

### Usage
## Support what kinds of scrollType

example :
- **TXScrollLabelViewTypeLeftRight** : scrolling from right to left, and cycle all contents(`scrollTitle`) in a single line.

NSString *scrollTitle = @"xxxxxxxx";
//options 是 TXScrollLabelViewType 枚举, 此处为了方便举例
TXScrollLabelView *scrollLabelView = [TXScrollLabelView tx_setScrollTitle:scrollTitle scrollType:options scrollVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut];

- **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!

## Usage

**Objective-C example :**

NSString *scrollTitle = @"xxxxxx";
//options 是 TXScrollLabelViewType 枚举类型, 此处仅为了方便举例
TXScrollLabelView *scrollLabelView = [TXScrollLabelView tx_setScrollTitle:scrollTitle scrollType:options scrollVelocity:3 options:UIViewAnimationOptionTransitionFlipFromTop];
[self.view addSubview:scrollLabelView];
//布局
scrollLabelView.frame = CGRectMake(50, 100 * (options + 0.7), 300, 44);
scrollLabelView.tx_centerX = [UIScreen mainScreen].bounds.size.width * 0.5;
//布局(Required)
scrollLabelView.frame = CGRectMake(50, 100 * (options + 0.7), 300, 30);
//偏好设置
//偏好(Optional)
scrollLabelView.tx_centerX = [UIScreen mainScreen].bounds.size.width * 0.5;
scrollLabelView.scrollInset = UIEdgeInsetsMake(0, 10 , 0, 10);
scrollLabelView.scrollSpace = 10;
scrollLabelView.font = [UIFont systemFontOfSize:15];
scrollLabelView.textAlignment = NSTextAlignmentCenter;
scrollLabelView.backgroundColor = [UIColor blackColor];
scrollLabelView.layer.cornerRadius = 5;
[self.view addSubview:scrollLabelView];
//开始滚动
[scrollLabelView beginScrolling];
self.scrollLabelView = scrollLabelView;
You can running **demo** for more details.
You can running **TXScrollLabelViewDemo** for more details.

**Swift example :** Producting.

## License

`TXScrollLabelView` is available under the MIT license. See the LICENSE file for more info.


0 comments on commit 2e27612

Please sign in to comment.