Skip to content

📷 Photo browser that simulates progressive loading 可以模拟渐进式加载的图片浏览器

License

Notifications You must be signed in to change notification settings

xuuhan/HXPhotoBrowser

Repository files navigation

HXPhotoBrowser

  • Photo browser that simulates progressive loading

  • Based on SDWebImage > 5.0

Language

Objective-C

Example

  • fade in list
 #import "HXUIButton+SDWebImage.h" or #import "HXUIImageView+SDWebImage.h"

 - (void)sd_setFadeImageWithURL:(nullable NSURL *)url;

image

  • style in photoBrowser
typedef NS_ENUM(NSUInteger, HXPhotoLoadType) {
    HXPhotoLoadTypeNormal = 0, //正常样式
    HXPhotoLoadTypeMask, //遮罩层样式
    HXPhotoLoadTypeProgressive //渐进式加载样式
};

typedef NS_ENUM(NSUInteger, HXPhotoProgressType) {
    HXPhotoProgressTypeRing = 0, //圆环网络加载进度
    HXPhotoProgressTypeBar //条状网络加载进度
};

image image image image

Use

OC

HXPhotoBrowserViewController *pb = [HXPhotoBrowserViewController new];
pb.parentVC = self; // viewController
pb.photoViewArray = _selectedViewArray.copy;
pb.currentIndex = sender.tag;
pb.urlStrArray = self.urlImgArray; // Local images are used in pb.imageArray
pb.config.photoLoadType = HXPhotoLoadTypeProgressive;
pb.config.photoProgressType = HXPhotoProgressTypeRing;
[pb show];

SWIFT

let pb = HXPhotoBrowserViewController.init()
pb.parentVC = self // viewController
pb.photoViewArray = imageViews
pb.currentIndex = sender.tag
pb.urlStrArray = urlStrArray // Local images are used in pb.imageArray
pb.config.photoLoadType = .progressive
pb.config.photoProgressType = .ring
pb.show()

demo中使用的网图时间久了存在着url失效的可能,如果在demo中遇到不显示图片的问题可以换一个图片url,我发现了会及时更新。

License

HXPhotoBrowser is available under the MIT license.

About

📷 Photo browser that simulates progressive loading 可以模拟渐进式加载的图片浏览器

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published