圖片放大瀏覽 仿微信朋友圈LLPhotoBrowser使用簡介

自己在工作閑暇之余寫了仿微信朋友圈的圖片瀏覽放大的框架 LLPhotoBrowser
希望能幫助大家快速開發 有什么問題可留言本人第一時間解答問題
有問題可留言 有喜歡的可動動小指頭點贊
GitHub地址:https://github.com/liuniuliuniu/LLPhotoBrowser

效果圖

LLPhotoBrowserAnim.gif

使用方法

 (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
    // 1 初始化
    LLPhotoBrowser *photoBrowser = [[LLPhotoBrowser alloc]init];
    // 2 設置代理
    photoBrowser.delegate = self;
    // 3 設置當前圖片
    photoBrowser.currentImageIndex = indexPath.item;
    // 4 設置圖片的個數
    photoBrowser.imageCount = self.photoArr.count;
    // 5 設置圖片的容器
    photoBrowser.sourceImagesContainerView = self.collectionView;
    // 6 展示
    [photoBrowser show];

}
// 代理方法 返回圖片URL
- (NSURL *)photoBrowser:(LLPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index{
    
    NSURL *url = [NSURL URLWithString:self.photoArr[index]];    
    return url;
}
// 代理方法返回縮略圖
- (UIImage *)photoBrowser:(LLPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index{
    
    NSIndexPath *indexPath = [NSIndexPath indexPathForItem:index inSection:0];
    
    LLPhotoCell *cell = (LLPhotoCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
    
    return cell.bigImgV.image;
    
}

此外 :里邊長按圖片進行保存圖片的LLActionSheetView 可進行自定義

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容