SDPhotoBrowser icon indicating copy to clipboard operation
SDPhotoBrowser copied to clipboard

你好,最近再用你的控件,非常好用。有几点小建议

Open stackJolin opened this issue 9 years ago • 1 comments

1.如果photos是collectionView的情况下,在collectionView复用、或者collectionView用删除添加操作的话,通过subViews去取sourceView的时候,是存在问题的。 建议可以添加一个代理方法:专门返回当前点击的子View,我改了一下,测试了几台机器,还是很好用的。请楼主采纳 添加的代理方法:

  • (UIView *)photoBrowserGetCurrentViewWithIndex:(NSInteger)index; 获取当前子View代理方法: UIView *sourceView = self.sourceImagesContainerView.subviews[self.currentImageIndex]; if ([self.delegate respondsToSelector:@selector(photoBrowserGetCurrentViewWithIndex:)]){ sourceView = [self.delegate photoBrowserGetCurrentViewWithIndex:self.currentImageIndex]; } 代理实现
  • (UIView *)photoBrowserGetCurrentViewWithIndex:(NSInteger)index { NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0]; WSTeamFeedCollecionCell *cell = (WSTeamFeedCollecionCell *)[self.productImageView cellForItemAtIndexPath:indexPath]; return cell; }

stackJolin avatar Aug 23 '16 04:08 stackJolin

感谢大兄弟,你这个方法很不错

chenchaohui6666 avatar Jan 09 '20 06:01 chenchaohui6666