美文网首页
轮播图点击图片放大

轮播图点击图片放大

作者: ljzza | 来源:发表于2018-03-28 13:45 被阅读0次
#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];
}

相关文章

网友评论

      本文标题:轮播图点击图片放大

      本文链接:https://www.haomeiwen.com/subject/nobycftx.html