iOS 图片浏览器 SDPhotoBrowser 的使用

2019-07-17  本文已影响0人  iOS门三闫

#import "SDPhotoBrowser.h"

@interface YjxCustomTableViewCell ()<SDPhotoBrowserDelegate>

@end

SDPhotoBrowser * broser =[[SDPhotoBrowser alloc] init];

 broser.currentImageIndex = indexPath.row-1;

 broser.sourceImagesContainerView = view;//这里必须是图片所存放在的view

 broser.imageCount = self.selectedImgArray.count;

 broser.delegate = self;

 [broser show];

//网址的iamge

-(NSURL*)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index{

    NSString *imageName = arrayImage[index];

    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@" ,imageName]];

    returnurl;

}

//大图浏览占位图

-(UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index {

    UIImage *img =[UIImage imageNamed:@"zhanweitu.png"];

   returnarr[index];

}

上一篇 下一篇

猜你喜欢

热点阅读