#import "KSPhotoBrowser.h"
/** 点击图片回调 */
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index
{
NSMutableArray * imagesGroup = [NSMutableArray arrayWithArray:cycleScrollView.imageURLStringsGroup];
NSMutableArray * items = [NSMutableArray array];
UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, cycleScrollView.width, cycleScrollView.height)];
[imageView sd_setImageWithURL:[NSURL URLWithString:imagesGroup[index]]];
for (int i = 0; i < imagesGroup.count; i ++)
{
KSPhotoItem * item = [KSPhotoItem itemWithSourceView:imageView imageUrl:[NSURL URLWithString:imagesGroup[i]]];
[items addObject:item];
}
KSPhotoBrowser *browser = [KSPhotoBrowser browserWithPhotoItems:items selectedIndex:index];
browser.dismissalStyle = KSPhotoBrowserInteractiveDismissalStyleSlide;
browser.pageindicatorStyle = KSPhotoBrowserPageIndicatorStyleDot;
browser.backgroundStyle = KSPhotoBrowserBackgroundStyleBlur;
[browser showFromViewController:self];
}
网友评论