DYMarqueeView
简介
一个可以高度自定义的iOS跑马灯。
功能点:
1.高度自定义视图。
2.适用于多种跑马灯应用场景。
3.代码简单,易于扩展。
博客
安装
使用 Cocoapods
pod 'DYMarqueeView'
当前最新版本1.0.0,如果无法搜索最新版本,请执行命令 pod setup 更新 pod 后再试。
持续优化中,如果您有好的建议和意见,欢迎交流,QQ 群:433212576
用法
类似于 UITableView,详细用法见 Demo。
/**
#pragma mark - DYMarqueeViewDelagete
- (NSInteger)numberOfMarqueeView:(DYMarqueeView *)marqueeView {
return 4;
}
- (UIView *)marqueeView:(DYMarqueeView *)marqueeView cellViewWithIndexPath:(NSIndexPath *)indexPath {
MarqueeTestCell *cell = [marqueeView dequeueReusableCellWithIndexPath:indexPath];
if (!cell) {
cell = [[MarqueeTestCell alloc] init];
}
cell.index = indexPath.row;
[cell.button setTitle:_dataArray[indexPath.row] forState:UIControlStateNormal];
return cell;
}
- (CGFloat)marqueeView:(DYMarqueeView *)marqueeView widthCellWithIndex:(NSInteger)index {
if (marqueeView.tag == 1000 ) {
return self.view.bounds.size.width;
}
return 50;
}