# LXBRollingView **Repository Path**: liuboliu/lxbrolling-view ## Basic Information - **Project Name**: LXBRollingView - **Description**: 一款iOS竖直轮播组件,支持普通滚动,渐隐样式,可以高度自定义,支持pod 导入 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-06-21 - **Last Updated**: 2024-06-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: 竖直广播轮播框架, 支持同时展示不同样式视图 ## README # XBRollingView [![CI Status](https://img.shields.io/travis/liuboliu/XBRollingView.svg?style=flat)](https://travis-ci.org/liuboliu/XBRollingView) [![Version](https://img.shields.io/cocoapods/v/XBRollingView.svg?style=flat)](https://cocoapods.org/pods/XBRollingView) [![License](https://img.shields.io/cocoapods/l/XBRollingView.svg?style=flat)](https://cocoapods.org/pods/XBRollingView) [![Platform](https://img.shields.io/cocoapods/p/XBRollingView.svg?style=flat)](https://cocoapods.org/pods/XBRollingView) ## Example To run the example project, clone the repo, and run `pod install` from the Example directory first. ## Requirements ## Installation XBRollingView is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby pod 'XBRollingView' ``` ## use method ``` ///自定义cell,继承于 XBNoticeViewCell @interface LXBCustomRollingCell : XBNoticeViewCell @end ``` ``` typedef NS_ENUM(NSUInteger, RollingStyle) { RollingStyleDefault = 0, ///默认样式,滚动轮播 RollingStyleFade = 1, /// 渐隐轮播 }; ``` ``` - (void)viewDidLoad { [super viewDidLoad]; XBRollingNoticeView *rollView = [[XBRollingNoticeView alloc] initWithFrame:CGRectMake(10, 100, 200, 70)]; [rollView registerClass:[LXBCustomRollingCell class] forCellReuseIdentifier:NSStringFromClass([LXBCustomRollingCell class])]; ///动画时间 rollView.animationDuration = 0.3; ///停留时间 rollView.stayInterval = 3; rollView.style = RollingStyleFade; rollView.delegate = self; rollView.dataSource = self; [rollView reloadDataAndStartRoll]; [self.view addSubview:rollView]; } #pragma mark - LXBRollingNoticeViewDelegate, LXBRollingNoticeViewDelegate - (XBNoticeViewCell *)rollingNoticeView:(XBRollingNoticeView *)rollingView cellAtIndex:(NSUInteger)index { LXBCustomRollingCell *cell = [rollingView dequeueReusableCellWithIdentifier:NSStringFromClass([LXBCustomRollingCell class])]; [cell updateWithRow:index]; return cell; } - (NSInteger)numberOfRowsForRollingNoticeView:(XBRollingNoticeView *)rollingView { return 4; } ``` ![Image text](https://gitee.com/liuboliu/lxbrolling-view/raw/master/2021-09-21%2009.45.40.gif) ![Image text](https://gitee.com/liuboliu/lxbrolling-view/raw/master/2024-06-06%2020.56.20.gif) ## Author liuboliu, 25234660131@qq.com ## License XBRollingView is available under the MIT license. See the LICENSE file for more info.