非常简单好用的无限轮播
来源:互联网 发布:使命召唤账号数据异常 编辑:程序博客网 时间:2024/04/30 07:16
今天写东西用到无限轮播,用了一个别人的demo,功能看着特别全,也很好,但是仔细看图片自动轮播的时候不顺畅,然后就搜了一下好用的轮播,自己改了一下更符合平时用了,就记录一下吧,以后省的忘记了哈
demo:http://download.csdn.net/detail/tuwanli125/9470322
demo地址:https://github.com/tuwanli/UNLimitedRollDemo
这个无限轮播可以显示本地图片也可以显示网络图片
真的很简单也很好用
上需求代码展示用法:只需要选择你是用本地图片还是网络图片就ok了
#import "RollMainVC.h"
#import "BannerScrollView.h"
#import "HeaderModel.h"
@interface RollMainVC ()<didWithImageDelegate>
{
BannerScrollView *banView;
}
@property (nonatomic,strong)NSMutableArray *array;
@property (nonatomic,strong)NSArray *netArr;
@property (nonatomic,copy)NSString *imageType;
@end
@implementation RollMainVC
- (void)viewDidLoad {
[superviewDidLoad];
/*
*显示网络图片
*/
NSDictionary *dict1 =@{@"image":@"http://www.pj-hospital.com/d/file/998885555544/2014-04-28/06cca200bf633ab6868e499a0657fec0.jpg",@"title":@"盘锦市中心医院"};
NSDictionary *dict2 =@{@"image":@"http://www.pj-hospital.com/d/file/998885555544/2014-04-28/f23199a3db612e6e3758840b4a5a0753.jpg",@"title":@"院内展示"};
NSDictionary *dict3 =@{@"image":@"http://www.pj-hospital.com/d/file/998885555544/2014-04-28/1893b9d20b9a0da0ca7c2f1747a5be72.jpg",@"title":@"鄂尔多斯市中心医院"};
NSDictionary *dict4 =@{@"image":@"http://www.pj-hospital.com/d/file/998885555544/2014-04-28/4307e2e9d6a490821c8e99c23957e82d.jpg",@"title":@"桓仁中心医院"};
_netArr= [[NSMutableArrayalloc]initWithObjects:dict1,dict2,dict3,dict4,nil];
_imageType = @"网络";
/*
*显示本地图片
*/
NSDictionary *dict5 =@{@"image":@"1",@"title":@"盘锦市中心医院"};
NSDictionary *dict6 =@{@"image":@"2",@"title":@"院内展示"};
NSDictionary *dict7 =@{@"image":@"3",@"title":@"鄂尔多斯市中心医院"};
NSDictionary *dict8 =@{@"image":@"4",@"title":@"桓仁中心医院"};
_imageType = @"本地";
_netArr= [[NSMutableArrayalloc]initWithObjects:dict5,dict6,dict7,dict8,nil];
/*
代码如下
*/
banView = [BannerScrollViewcreateHeader];
banView.delegate =self;
banView.imagetype =_imageType;
banView.frame =CGRectMake(0,0, [UIScreenmainScreen].bounds.size.width,300);
banView.imgArr =self.array;
[self.viewaddSubview:banView];
}
- (NSArray *)array
{
if (_array ==nil) {
_array = [[NSMutableArrayalloc]init];
for (NSDictionary *dictin_netArr) {
HeaderModel *model = [[HeaderModelalloc]initWithHeaderModel:dict];
[_arrayaddObject:model];
}
}
return_array;
}
- (void)didImage:(NSInteger)index
{
NSLog(@"点击第%d张图片",index+1);
}
- (void)didReceiveMemoryWarning {
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
- 非常简单好用的无限轮播
- 简单的ViewPager无限轮播
- 简单的无限轮播封装
- 无限轮播的简单实现
- 无限轮播的Banner简单方法
- 无限轮播 RollViewPager 的简单使用
- 网络无限轮播的简单实现
- 非常简单的轮播方法
- 无限轮播简单方法
- 非常好用的无限轮播
- 图片无限轮播-最简单的实现方法
- 简单实现 scrollview无限轮播的封装
- android无限轮播广告的简单实现
- 安卓最简单的轮播图实现无限轮播
- 一款支持无限轮播、简单易用、扩展性强且超级稳定的轮播图库-Banner(BannerView)
- ViewPager的无限轮播
- 无限轮播的实现
- 图片的无限轮播
- 被H5逐渐侵蚀的app原生环境
- [ssh新闻发布系统五]删除新闻
- 线性表的顺序存储结构(含源码)
- C++ Assert()断言机制原理以及使用
- CSS3复习——小三角、旋转、过渡
- 非常简单好用的无限轮播
- TrustZone OP-TEE 在 FVP 编译与测试
- AngularJS表达式
- memcache安装部署
- Linux中的Apache服务查看和启动的方法
- win10系统PL2303串口连接出现错误的解决方案
- 使用NSURLSession,POST 上传多个文件,和文本内容(原理)
- 异步servlet
- 编程书单:十本Python编程语言的入门书籍