From c131f85253ac087beac983d4d37837a3e6e6656c Mon Sep 17 00:00:00 2001 From: tpctt <491590253@qq.com> Date: Sat, 21 Nov 2015 13:14:13 +0000 Subject: [PATCH] Update SDPhotoBrowser.m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit // 防止 因imageview的image加载失败 导致 崩溃, 避免width=0的时候,出现 除数=0的情况 --- SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.m b/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.m index 0b0953b..53dd609 100755 --- a/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.m +++ b/SDPhotoBrowser/SDPhotoBrowser/SDPhotoBrowser.m @@ -187,6 +187,10 @@ - (void)photoClick:(UITapGestureRecognizer *)recognizer if (!currentImageView.image) { // 防止 因imageview的image加载失败 导致 崩溃 h = self.bounds.size.height; + }else if (currentImageView.image.size.width==0) { + // 防止 因imageview的image加载失败 导致 崩溃 + h=0; + } tempView.bounds = CGRectMake(0, 0, self.bounds.size.width, h);