uiscrollerview循环滚动(参考第三方库:HMBannerView)https://github.com/iunion/autoScrollBanner
#import <UIKit/UIKit.h> #import "HMBannerView.h" @interface ViewController : UIViewController<HMBannerViewDelegate> // Banner @property (nonatomic, strong) HMBannerView *bannerView; @end #import "ViewController.h" @interface ViewController () @property (strong, nonatomic) IBOutlet UIView *topView; @end @implementation ViewController - (void)dealloc { self.bannerView.delegate = nil; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. NSMutableArray *dataArray = [NSMutableArray arrayWithCapacity:]; NSDictionary *bannerDic = [NSDictionary dictionaryWithObjectsAndKeys:@"http://pic01.babytreeimg.com/foto3/photos/2014/0211/68/2/4170109a41ca935610bf8_b.png", @"img_url", nil]; [dataArray addObject:bannerDic]; bannerDic = [NSDictionary dictionaryWithObjectsAndKeys:@"http://pic01.babytreeimg.com/foto3/photos/2014/0127/19/9/4170109a267ca641c41ebb_b.png", @"img_url", nil]; [dataArray addObject:bannerDic]; bannerDic = [NSDictionary dictionaryWithObjectsAndKeys:@"http://pic02.babytreeimg.com/foto3/photos/2014/0207/59/4/4170109a17eca86465f8a4_b.jpg", @"img_url", nil]; [dataArray addObject:bannerDic]; if (self.bannerView != nil) { [self.bannerView reloadBannerWithData:dataArray]; } else { self.bannerView = [[HMBannerView alloc] initWithFrame:CGRectMake(, , _topView.frame.size.width, ) scrollDirection:ScrollDirectionLandscape images:dataArray]; [self.bannerView setRollingDelayTime:1.0];//设置定时时间 [self.bannerView setDelegate:self]; // [self.bannerView setSquare:1];设置边角 [self.bannerView setPageControlStyle:PageStyle_Middle];//分页控件的位置 [self.bannerView startDownloadImage]; [_topView addSubview:self.bannerView]; //[self.bannerView showClose:YES];不显示图片 } NSMutableArray *dataArray1 = [NSMutableArray arrayWithCapacity:]; NSDictionary *bannerDic1 = [NSDictionary dictionaryWithObjectsAndKeys:@"http://pic05.babytreeimg.com/foto3/photos/2014/0124/88/2/4170109a13aca59db86761_b.png", @"img_url", nil]; [dataArray1 addObject:bannerDic1]; bannerDic1 = [NSDictionary dictionaryWithObjectsAndKeys:@"http://pic01.babytreeimg.com/foto3/photos/2014/0124/18/3/4170109a253ca5b0d88192_b.png", @"img_url", nil]; [dataArray1 addObject:bannerDic1]; HMBannerView *bannerView = [[HMBannerView alloc] initWithFrame:CGRectMake(, , , ) scrollDirection:ScrollDirectionLandscape images:dataArray1]; [bannerView setRollingDelayTime:2.0]; [bannerView setDelegate:self]; [bannerView setSquare:]; [bannerView setPageControlStyle:PageStyle_Left]; [bannerView showClose:YES]; [bannerView startDownloadImage]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } #pragma mark - #pragma mark HMBannerViewDelegate - (void)imageCachedDidFinish:(HMBannerView *)bannerView { if (bannerView == self.bannerView) { if (self.bannerView.superview == nil) { [self.view addSubview:self.bannerView]; } [self.bannerView startRolling]; } else { [self.view addSubview:bannerView]; [bannerView startRolling]; } } - (void)bannerView:(HMBannerView *)bannerView didSelectImageView:(NSInteger)index withData:(NSDictionary *)bannerData { NSLog(@"bannerdata=%@,index=%d",bannerData,index); } - (void)bannerViewdidClosed:(HMBannerView *)bannerView; { if (bannerView.superview) { [bannerView removeFromSuperview]; } } @end
uiscrollerview循环滚动(参考第三方库:HMBannerView)https://github.com/iunion/autoScrollBanner的更多相关文章
- python 第三方模块 转 https://github.com/masterpy/zwpy_lst
Chardet,字符编码探测器,可以自动检测文本.网页.xml的编码. colorama,主要用来给文本添加各种颜色,并且非常简单易用. Prettytable,主要用于在终端或浏览器端构建格式化的输 ...
- Java WebSocket库:https://github.com/TooTallNate/Java-WebSocket
https://github.com/TooTallNate/Java-WebSocket 以下是简单示例: import com.google.gson.JsonObject; import com ...
- iOS-启动项目(二)引入第三方库
摘要 项目中很大几率会用到第三方库,通过 Pod 方式引入第三方库是效率很高的方式,这里介绍一个新的项目搭建 Pod 方式的环境,方便项目中引入第三方库文件. 刚创建的项目中如果需要用到第三方库,常用 ...
- iOS 学习笔记 十三 (2015.04.15)采用第三方库,实现ios录音转为amr
1.第三方开源库地址 https://github.com/guange2015/ios-amr 2.参考博客地址 http://blog.csdn.net/windsoul85/article/de ...
- 你一定能用的上的iOS第三方库
点国内程序员不常用的热门iOS第三方库:看完,还敢自称"精通iOS开发"吗? 综合github上各个项目的关注度与具体使用情况,涵盖功能,UI,数据库,自动化测试,编程工具等类型, ...
- iOS第三方库
热门iOS第三方库:看完,还敢自称”精通iOS开发”吗? 综合github上各个项目的关注度与具体使用情况,涵盖功能,UI,数据库,自动化测试,编程工具等类型,看完,还敢自称”精通iOS开发”吗? h ...
- python第三方库,你要的这里都有
Python的第三方库多的超出我的想象. python 第三方模块 转 https://github.com/masterpy/zwpy_lst Chardet,字符编码探测器,可以自动检测文本. ...
- 一些 iOS 常用的第三方库
网络通信 AFNetworking 轻量级的通讯类库,使用非常简单.建议更新到最新版,前几天看新闻说之前有个逻辑性的 bug https://github.com/AFNetworking/AFNet ...
- ios常用的第三方库
ios开发中有可能用到的第三方库进行记录一下: 注:资料信息来源于网络 自己整理 https://developer.apple.com/reference(苹果官方文档) https://gith ...
随机推荐
- java线性表学习笔记(二)
链表中的每一个元素都包含一个称为节点的结构,每向链表中增加一个元素,就会产生一个与之相关的节点,每个节点与它相邻的节点相连接(这是基础吧,不过在看c的时候没认真看,呼). 定义节点类如下(使用了泛型, ...
- C++11空指针
[C++11空指针] 早在 1972 年,C语言诞生的初期,常数 0 带有常数及空指针的双重身分. C 使用 preprocessor macro NULL 表示空指针, 让 NULL 及 0 分别代 ...
- 微软IOC容器Unity简单代码示例2-配置文件方式
@(编程) 1. 通过Nuget下载Unity 这个就不介绍了 2. 接口代码 namespace UnityDemo { interface ILogIn { void Login(); } } n ...
- STM32F407存储器和总线架构
http://www.cnblogs.com/ransn/p/5654068.html
- KMP应用http://acm.hdu.edu.cn/showproblem.php?pid=2594
riemann与marjorie拼接后riemannmarjorie前缀与后缀公共部分为 rie 长度为 3(即next[l] = next[14]的值,l为拼接后的长度)但:aaaa与aa拼接后aa ...
- ASA与PIX的区别
很多年来,Cisco PIX一直都是Cisco确定的防火墙.但是在2005年5月,Cisco推出了一个新的产品——适应性安全产品(ASA,Adaptive Security Appliance).不过 ...
- oracle学习 八 分页(使用rownumber)(持续更)
rownumber是查询的数据集之后加入一个伪列(连续的)使用它可以去制作以oracle数据库为基础的分页,语句类似于公式直接套用如下: select * from (select rownum r, ...
- 【转】android 自定义ViewPager,修改原动画
转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/38026503 记 得第一次见到ViewPager这个控件,瞬间爱不释手,做东西的 ...
- Gartner: Hype Cycle for Emerging Technologies-2012 (技术成熟度曲线) [转]
英文稿: The “Hype Cycle for Emerging Technologies” report is the longest-running annual Hype Cycle, p ...
- 认识position=fixed
(从已经死了一次又一次终于挂掉的百度空间人工抢救出来的,发表日期2014-01-13) position=fixed是相对于浏览器边框的位置.