Skip to content

About

The image browser supports both local and network(图片浏览器,支持本地和网络图片)

Resources

Stars

25 stars

Watchers

1 watching

Forks

Repository files navigation

DMLPhotoBrowser

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements&&demonstration

Demo

Installation

DMLPhotoBrowser is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'DMLPhotoBrowser', '~> 0.1.6'

Use

注意此框架依赖 FLAnimatedImage和SDWebImage,下面是具体如何使用(请参考demo,欢迎Issues)

本地/相册图片浏览

 
    NSMutableArray *photoItems = [NSMutableArray array];
    int i = 0;
    for (UIImage *image in self.images) {
        UIImageView *imageViewSource = self.bgview.subviews[i];
        DMLPhotoItem *item = [[DMLPhotoItem alloc] initWithSourceView:imageViewSource image:image];
        [photoItems addObject:item];
        i ++;
    }
    DMLPhotoBrowser *Browser = [[DMLPhotoBrowser alloc] initWithPhotoItems:photoItems selectedIndex:imageView.tag];
    [Browser showPhotoBrowser];

网络图片浏览

    NSMutableArray *photoItems = [NSMutableArray array];
    int i = 0;
    for (NSString *url in self.originalURLs) { 
        FLAnimatedImageView *imageViewSource = self.bgview.subviews[i];
        DMLPhotoItem *item = [[DMLPhotoItem alloc] initWithSourceView:imageViewSource thumbImage:imageViewSource.image       imageUrl:[NSURL URLWithString:url]];
        [photoItems addObject:item];
        i ++;
    }
    DMLPhotoBrowser *Browser = [[DMLPhotoBrowser alloc] initWithPhotoItems:photoItems selectedIndex:imageView.tag];
    [Browser showPhotoBrowser];

Author

NickName:MrDML, E-Mail:dml1630@163.com, QQ:1969339388

License

DMLPhotoBrowser is available under the MIT license. See the LICENSE file for more info.

About

The image browser supports both local and network(图片浏览器,支持本地和网络图片)

Resources

Stars

25 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages