Latest | 1.0.0 |
---|---|
Homepage | https://github.com/dolacmeng/JXScrollView |
License | MIT |
Platforms | ios 7.0, requires ARC |
Dependencies | SDWebImage |
Frameworks | UIKit, Foundation |
Authors |
只要几行代码,快速集成轮播控件,支持本地图片和网络图片,支持点击事件,可定制播放速度、指示器颜色/位置、默认图等。
Installation【安装】
From CocoaPods【使用CocoaPods】
pod 'JXScrollView'
Examples【示例】
两步快速集成方法:
1.初始化:
JXScrollViewConfig *config = [JXScrollViewConfig defalutConfig];
JXScrollView *scroll = [[JXScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREENW, 200) config:config dataSource:self delegate:self];
[self.view addSubview:scroll];
[scroll start];
2.实现数据源方法(至少实现以下两个)
//返回轮播图片数量
-(NSInteger)numberOfItemInScrollView:(JXScrollView *)scrollView{
return imageArr.count;
}
//返回轮播的图片url
-(NSURL*)scrollView:(JXScrollView *)scrollView urlForItemAtIndex:(NSInteger)index{
return [NSURL URLWithString:imageArr[index]];
}
效果:
扩展
如果要修改PageControl在左边,选中颜色为红色,未选中为绿色。将初始化改为:
JXScrollViewConfig *config = [JXScrollViewConfig defalutConfig];
config.pageControlPosition(JXScrollViewPageControlPositionLeft).pageControlTintColor([UIColor redColor]).pageIndicatorSelectedTintColor([UIColor greenColor]);
JXScrollView *scroll = [[JXScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREENW, 200) config:config dataSource:self delegate:self];
[self.view addSubview:scroll];
[scroll start];
Latest podspec
{ "name": "JXScrollView", "version": "1.0.0", "summary": "u8f6eu64adu63a7u4ef6", "description": "u53eau8981u51e0u884cu4ee3u7801uff0cu5febu901fu96c6u6210u8f6eu64adu63a7u4ef6uff0cu652fu6301u672cu5730u56feu7247u548cu7f51u7edcu56feu7247uff0cu652fu6301u70b9u51fbu4e8bu4ef6uff0cu53efu5b9au5236u64adu653eu901fu5ea6u3001u6307u793au5668u989cu8272/u4f4du7f6eu3001u9ed8u8ba4u56feu7b49u3002", "homepage": "https://github.com/dolacmeng/JXScrollView", "license": "MIT", "authors": { "Jack": "[email protected]" }, "platforms": { "ios": "7.0" }, "source": { "git": "https://github.com/dolacmeng/JXScrollView.git", "tag": "1.0.0" }, "source_files": "JXScrollView/JXScrollView/*", "frameworks": [ "UIKit", "Foundation" ], "requires_arc": true, "dependencies": { "SDWebImage": [] } }
Thu, 16 May 2019 10:37:03 +0000