# ADRollingView **Repository Path**: soyeon/ADRollingView ## Basic Information - **Project Name**: ADRollingView - **Description**: 上下滚动广告、新闻效果。 - **Primary Language**: Objective-C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-06-21 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #ADRollingView ##一个简单的标题滚动的控件。 ##使用方法: ###1.导入头文件 ``` #import "ADRollingView.h" ``` ###2.初始化:带图标初始化: ``` ADRollingView *adView = [[ADRollingView alloc] initWithIcons:@[@"http://imgsrc.baidu.com/forum/pic/item/b64543a98226cffc8568eff1b9014a90f603ea37.jpg", @"http://imgm.photophoto.cn/086/029/025/0290250043.jpg"] Titles:@[@"嘿嘿", @"嘻嘻"] Frame:CGRectMake(0, 64, self.view.frame.size.width, 40)]; adView.delegate = self; [self.view addSubview:adView]; ``` ###3.只显示标题初始化 ``` ADRollingView *adView = [[ADRollingView alloc] initWithTitles:@[@"呵呵",@"嘻嘻"] Frame:CGRectMake(0, 64, self.view.frame.size.width, 40)]; adView.delegate = self; [self.view addSubview:adView]; ``` ###4.如果要处理点击事件,则实现代理方法 ``` - (void)rollingView:(ADRollingView *)rollingView didSelectIndex:(NSInteger)index{ NSLog(@"%ld", index); } ```