前言
前段時間在開發一個廣播的功能,網上也自己找了一些庫,沒有發現非常好用的,於是自己抽時間寫了一個,在 Github
上釋出一天收穫六十多個 star
,這裡首先感謝大家在微博上的轉發,使得 TXScrollLabelView
被更多需要的人知道,同時也非常感謝大家的吐槽及建議,使之誕生 TXScrollLabelView
v1.1.1 版本,在此版本中針對大家在微博上的吐槽和建議進行改善,並優化。目前已支援 CocoaPods
,後續會支援 Carthage
。Github 地址: TXScrollLabelView
1 2 3 4 5 6 7 8 9 |
pod search TXScrollLabelView -> TXScrollLabelView (1.1.1) The best way to show & display such as adverts,boardcast,OnSale e.g. with a customView. pod 'TXScrollLabelView', '~> 1.1.1' - Homepage: https://github.com/tingxins/TXScrollLabelView - Source: https://github.com/tingxins/TXScrollLabelView.git - Versions: 1.1.1 [master repo] |
TXScrollLabelView ?
TXScrollLabelView
是一個能夠快速接入自定義標籤滾動檢視,可以做促銷欄、頭條欄、廣播欄、廣告欄等等展示,效果圖:
支援滾動型別
現在 TXScrollLabelView
支援4種滾動型別:
TXScrollLabelViewTypeLeftRight
:從右向左單行滾動TXScrollLabelViewTypeUpDown
:從下至上多行滾動TXScrollLabelViewTypeFlipRepeat
:從下至上單行迴圈滾動TXScrollLabelViewTypeFlipNoRepeat
:從下至上單行依次滾動
前幾天 GitHub
有人提出 scrollVelocity
針對相關型別失效問題,現在已經全部解決,以上四種型別 scrollVelocity
全部支援啦。後期會持續增加更多的功能,滿足更多的需求。
如何接入 ?
目前支援兩種方式整合 TXScrollLabelView
:
- 使用
cocoaPods
12platform :ios, '7.0'pod 'TXScrollLabelView' - 手動
Clone
或者DownloadZip
至本地,然後手動拖拽TXScrollLabelView
資料夾中的檔案至專案中,使用的時候#import "TXScrollLabelView.h“
即可。
如何使用 ?
直接上程式碼:
1 2 3 4 5 6 |
//1.獲取滾動的內容 NSString *scrollTitle = @"xxxxxx"; //2.建立TXScrollLabelView TXScrollLabelView *scrollLabelView = [TXScrollLabelView scrollWithTitle:scrollTitle type:0 velocity:3 options:UIViewAnimationOptionTransitionFlipFromTop]; //3.開始滾動 [scrollLabelView beginScrolling]; |
更多請詳見Demo:
https://github.com/tingxins/TXScrollLabelView/tree/master/TXScrollLabelViewDemo