項(xiàng)目需導(dǎo)入SDWebImage
類型一
簡(jiǎn)單的輪播圖
輪播下.gif
/**
加載演示類型1 圖
*/
_jy2ScrollView = [[JYScrollView alloc] initWithFrame:CGRectMake(0, Fit375(350), kScreenWidth, Fit375(230))];
[_jy2ScrollView bannerWithArray:array imageType:JYImageURLType placeHolder:@"placeholderImage.jpg" tapAction:^(NSInteger index) {
NSLog(@"點(diǎn)擊了輪播圖click NO.%ld",index);
}];
_jy2ScrollView.timeInterval = 4;
[self.view addSubview:_jy2ScrollView];
類型二
帶描述的輪播圖
輪播上.gif
/**
加載演示類型2 圖 + 描述
*/
/**
set UI frame,JYScrollview's pageControl is depend on the screen's width,if you want to make a different one you could click JYScrollView.m to change the size or something.
*/
_jyScrollView = [[JYScrollView alloc] initWithFrame:CGRectMake(0, Fit375(50), kScreenWidth, Fit375(230))];
/**
* the array's count must equals to the titleArr's
* loadScrollViewData
*/
[_jyScrollView bannerWithArray:array titleArr:titleArr imageType:JYImageURLType placeHolder:@"placeholderImage.jpg" tapAction:^(NSInteger index) {
NSLog(@"點(diǎn)擊了輪播圖click NO.%ld",index);
}];
_jyScrollView.timeInterval = 1;
[self.view addSubview:_jyScrollView];
自定義pageControl的位置
/**
* or you can set the pageControl
*
CGPoint center =_jy2ScrollView.pageControl.center;
center.x = 350;
_jy2ScrollView.pageControl.center = center;
*/
如果控件哪里有什么問題蕾盯,敬請(qǐng)斧正匙隔。