SDPhotoBrowser
SDPhotoBrowser copied to clipboard
你好,最近再用你的控件,非常好用。有几点小建议
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; }
感谢大兄弟,你这个方法很不错