对无限图片轮播器的封装,一句话代码设置轮播器的属性
2016-07-14 21:15
309 查看
提供给外界的接口:
BOOL isAutoCycle ---是否需要自动轮播
NSArray imageArray --- 图片数组
NSArray titleArray --- 文本数组
NSInteger timeDelay --- 图片轮播延迟
//代理方法设定的范例
//示例:****- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
//示例:****- (nullable NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView
#import <UIKit/UIKit.h>
@class WZHCycleView;
@protocol wzhCycleViewDelegate <NSObject>
@required
/**
* 外界给轮播器传递图片数组的代理方法
*
* @return 返回一个图片名数组
*/
- (nonnull NSArray<NSString *> *)imageArrayForWZHCycleView;
@optional
/**
* 外界给轮播器传送label的标题数组代理方法
*
* @return 返回一个label的显示内容的数组
*/
- (nullable NSArray <NSString *> *)titleArrayForWZHCycleView;
@end
@interface WZHCycleView : UIView
@property (weak,nonatomic) id <wzhCycleViewDelegate>
delegate;
@property (assign,nonatomic) CGFloat timeDelay;
@property (assign,nonatomic,getter=isAutoCycle) BOOL autoCycle;
@property (assign,nonatomic,getter=isNetImage) BOOL netImage;
- (nonnull WZHCycleView *)initWithFrame:(CGRect)frame;
+ (nonnull WZHCycleView *)wzhCycleViewWithFrame:(CGRect)frame;
@end
想看具体demo代码:点我
BOOL isAutoCycle ---是否需要自动轮播
NSArray imageArray --- 图片数组
NSArray titleArray --- 文本数组
NSInteger timeDelay --- 图片轮播延迟
//代理方法设定的范例
//示例:****- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
//示例:****- (nullable NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView
#import <UIKit/UIKit.h>
@class WZHCycleView;
@protocol wzhCycleViewDelegate <NSObject>
@required
/**
* 外界给轮播器传递图片数组的代理方法
*
* @return 返回一个图片名数组
*/
- (nonnull NSArray<NSString *> *)imageArrayForWZHCycleView;
@optional
/**
* 外界给轮播器传送label的标题数组代理方法
*
* @return 返回一个label的显示内容的数组
*/
- (nullable NSArray <NSString *> *)titleArrayForWZHCycleView;
@end
@interface WZHCycleView : UIView
@property (weak,nonatomic) id <wzhCycleViewDelegate>
delegate;
@property (assign,nonatomic) CGFloat timeDelay;
@property (assign,nonatomic,getter=isAutoCycle) BOOL autoCycle;
@property (assign,nonatomic,getter=isNetImage) BOOL netImage;
- (nonnull WZHCycleView *)initWithFrame:(CGRect)frame;
+ (nonnull WZHCycleView *)wzhCycleViewWithFrame:(CGRect)frame;
@end
想看具体demo代码:点我
相关文章推荐
- android 代码实现控件之间的间距
- [Android]在代码里运行另一个程序的方法
- 个人信息安全报告发布:有 APP 每分钟调用位置权限 1468 次
- 下载量超过一亿的流行应用被发现含有恶意模块
- 肯特·贝克:改变人生的代码整理魔法
- 苹果与Siri的七年之痒:“宫斗”戏码不断上演
- 网页恶意代码的预防
- 高手写的Tracer-Flash代码调试类代码下载
- CSS代码缩写技巧
- 非主流Q-zOne代码代码搜集第1/2页
- CreateWeb.vbs 代码
- Lua中编译执行代码相关的函数详解
- 更有效率的css代码编写第1/3页
- APP添加CNZZ统计插件教程 Android版添加phonegap
- 代码中到底应不应当写注释?
- SQL语言查询基础:连接查询 联合查询 代码
- 论坛头像随机变换代码
- 非常有用的9个PHP代码片段
- .NET 常用功能和代码小结
- C#实现压缩HTML代码的方法