Viper
Viper
// 因为等着上线就测了下 发现了问题的地方 已经改了但是git提交不上去 // 第一个地方 - (void)photoClick:(UITapGestureRecognizer *)recognizer { _scrollView.hidden = YES; SDBrowserImageView *currentImageView = (SDBrowserImageView *)recognizer.view; NSInteger currentIndex = currentImageView.tag; /** - sourceImagesContainerView 的子控件只有5个 如果下标超过4就会取值报错,我测了下你这个subview的作用好像是做效果用的 所以最好是模一下subViews.count,下同 一个应该是打开效果一个是收缩效果。望采纳,个人觉得给个随机数比较好,效果随机 如果取模的话每个index的效果就固定了...
// 第二个地方 - (void)showFirstImage { /** - sourceImagesContainerView 的子控件只有5个 如果下标超过4就会取值报错,我测了下你这个subview的作用好像是做效果用的 所以最好是模一下subViews.count */ UIView *sourceView = self.sourceImagesContainerView.subviews[self.currentImageIndex % self.sourceImagesContainerView.subviews.count]; CGRect rect = [self.sourceImagesContainerView convertRect:sourceView.frame toView:self];