Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ericdream/ImagePreview

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ImagePreview

仿微信图片预览

1、只需要#import "SYPicturePreviewView.h" 就可以使用

2、demo

   SYPicturePreviewView *previewImageView = [[SYPicturePreviewView alloc] initWithFrame:[UIScreen mainScreen].bounds];
   previewImageView.allImages = previewImages; // 需要预览的所有图片对象
   //ImageCollectionViewCell *cell1 = (ImageCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
  // CGRect rect = [cell1.contentView.superview convertRect:cell1.contentView.frame toView:[UIApplication sharedApplication].keyWindow];
// 传入点击图片的位置
   [previewImageView showWithFristImage:cell1.imageView.image fromIndex:indexPath.row fromRect:rect];
   previewImageView.delegate = self; // 实现代理
#pragma SYPicturePreviewViewDelegate
- (CGRect)disMisWithIndex:(NSInteger)index view:(SYPicturePreviewView *)view{
  // NSIndexPath *path = [NSIndexPath indexPathForRow:index inSection:0];
   // ImageCollectionViewCell *cell1 = (ImageCollectionViewCell *)[self.collectionView cellForItemAtIndexPath:path];
   //CGRect toRect = [cell1.contentView.superview convertRect:cell1.contentView.frame toView:[UIApplication sharedApplication].keyWindow];
   return toRect; //返回点击图片对应的消失位置
}

About

仿微信图片预览

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.