iOS開源:TXScrollLabelView - 跑馬燈
前言
前段時間在開發一個廣播的功能,網上也自己找了一些庫,沒有發現非常好用的,于是自己抽時間寫了一個,在 Github 上發布一天收獲六十多個 star ,這里首先感謝大家在微博上的轉發,使得 TXScrollLabelView 被更多需要的人知道,同時也非常感謝大家的吐槽及建議,使之誕生 TXScrollLabelView v1.1.1 版本,在此版本中針對大家在微博上的吐槽和建議進行改善,并優化。目前已支持 CocoaPods ,后續會支持 Carthage 。
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]</code></pre>
TXScrollLabelView ?
TXScrollLabelView 是一個能夠快速接入自定義標簽滾動視圖,可以做促銷欄、頭條欄、廣播欄、廣告欄等等展示,效果圖:



支持滾動類型
現在 TXScrollLabelView 支持4種滾動類型:
-
TXScrollLabelViewTypeLeftRight :從右向左單行滾動
-
TXScrollLabelViewTypeUpDown :從下至上多行滾動
-
TXScrollLabelViewTypeFlipRepeat :從下至上單行循環滾動
-
TXScrollLabelViewTypeFlipNoRepeat :從下至上單行依次滾動
前幾天 GitHub 有人提出 scrollVelocity 針對相關類型失效問題,現在已經全部解決,以上四種類型 scrollVelocity 全部支持啦。后期會持續增加更多的功能,滿足更多的需求。
如何接入 ?
目前支持兩種方式集成 TXScrollLabelView :
-
使用 cocoaPods
platform :ios, '7.0'
pod 'TXScrollLabelView'
-
手動
Clone 或者 DownloadZip 至本地,然后手動拖拽 TXScrollLabelView 文件夾中的文件至項目中,使用的時候 #import "TXScrollLabelView.h“ 即可。
如何使用 ?
直接上代碼:
//1.獲取滾動的內容
NSString *scrollTitle = @"xxxxxx";
//2.創建TXScrollLabelView
TXScrollLabelView *scrollLabelView = [TXScrollLabelView scrollWithTitle:scrollTitle type:0 velocity:3 options:UIViewAnimationOptionTransitionFlipFromTop];
//3.開始滾動
[scrollLabelView beginScrolling];