gitHub那些优秀的库和想要实现的效果

1. 轮播库SDCycleScrollView

2. 自动布局库SDAutoLayout

3. 类似支付宝福卡滑动切换的效果 https://github.com/huangxuan518/HXCardSwitchView

4. 类似朋友圈图片浏览SDPhotoBrowser :SDAutoLayout 中也能找到哦,基本思路就是,点击之后用UIScrollView表示,添加单机双击手势,利用UIScrollView的缩放属性来做。

 

使用SDPhotoBrowser最重要的几个参数:比如这里是调起

SDPhotoBrowser

图片浏览的地方

- (void)tapImageView:(UITapGestureRecognizer *)tap
{
    UIView *imageView = tap.view;
    SDPhotoBrowser *browser = [[SDPhotoBrowser alloc] init];
    browser.currentImageIndex = imageView.tag; //当前点击的图片下标
    browser.sourceImagesContainerView = self;//self就是cell中的imgV的父view 
    browser.imageCount = (int)self.photos.count; //图片的数量
    //browser.imageCount = self.picPathStringsArray.count;
    browser.delegate = self; //设置代理 在代理方法中加载放大后的图片
    [browser show]; 
    
}

还有两个重要的代理方法:

#pragma mark - SDPhotoBrowserDelegate


 


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


{


//    return [NSURL URLWithString:@"http://img01.taopic.com/160615/240367-16061509430238.jpg"];


    


    return [NSURL URLWithString:_imgArr[index]];


}


 


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


{


    


    CheckListCVCell * cell = (CheckListCVCell *)[self.collectionV cellForItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];


    


    UIImageView *imageView = cell.imageV;


    


    return imageView.image;


}








 

posted @ 2018-04-23 13:46  liuw_flexi  阅读(294)  评论(0编辑  收藏  举报