Coder Social home page Coder Social logo

xuuhan / hxphotobrowser Goto Github PK

View Code? Open in Web Editor NEW
92.0 1.0 13.0 7.71 MB

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

License: MIT License

Objective-C 90.80% Ruby 8.08% C 1.12%
photobrowser picture picturebrowser photo progressive-image progressive-image-loading

hxphotobrowser's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.