-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,58 @@ | ||
# TXScrollLabelView | ||
|
||
[](https://www.apache.org/licenses/LICENSE-2.0.html) | ||
[](https://github.com/tingxins/TXScrollLabelView)[](https://github.com/tingxins/TXScrollLabelView)[](https://github.com/tingxins/TXScrollLabelView)[](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. | ||
|
||
 | ||
|
||
### 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. | ||
|
||
|