标签:
创建一对继承于UIView的类,在.h文件中添加属性、初始化方法,
// 数组 @property (nonatomic, strong) NSMutableArray *imgNameArray; // 初始化方法 - (instancetype)initWithFrame:(CGRect)frame interVal:(NSTimeInterval)interval; |
在.m的文件中添加相应的属性
// scrollView @property (nonatomic, strong) UIScrollView *imgScrollView; // pageControl @property (nonatomic, strong) UIPageControl *imgPageControl; // ImageViewArray @property (nonatomic, strong) NSMutableArray *imgViewArray; // 存放图片的数组 @property (nonatomic, strong) NSMutableArray *imgArray; // 当前展示的图片下标 @property (nonatomic, assign) NSInteger index; // 定时器 @property (nonatomic, strong) NSTimer *imgTimer; // 点击回调block @property (nonatomic, copy) void(^tapBlock)(NSInteger index); // 时间间隔 @property (nonatomic, assign) NSTimeInterval interval; |
标签:
原文地址:http://www.cnblogs.com/asdfg/p/5425906.html