From d2670fc443b2503e5697c6dfd033ea0fcaf3de6f Mon Sep 17 00:00:00 2001 From: Jaye Date: Tue, 12 Jan 2016 12:00:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E5=89=8D=E6=AD=A3?= =?UTF-8?q?=E5=9C=A8=E5=88=B7=E6=96=B0=E4=B8=AD=E6=97=B6=E8=B0=83=E7=94=A8?= =?UTF-8?q?beginRefreshing=E6=96=B9=E6=B3=95=E4=BD=BF=E5=BE=97header=20ins?= =?UTF-8?q?ert=E5=9B=9E=E7=BD=AE=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复当前正在刷新中时调用beginRefreshing方法使得header insert回置失败 --- MJRefresh/Base/MJRefreshComponent.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MJRefresh/Base/MJRefreshComponent.m b/MJRefresh/Base/MJRefreshComponent.m index 1b6ea277..bdf32b9a 100644 --- a/MJRefresh/Base/MJRefreshComponent.m +++ b/MJRefresh/Base/MJRefreshComponent.m @@ -144,9 +144,12 @@ - (void)beginRefreshing if (self.window) { self.state = MJRefreshStateRefreshing; } else { - self.state = MJRefreshStateWillRefresh; - // 刷新(预防从另一个控制器回到这个控制器的情况,回来要重新刷新一下) - [self setNeedsDisplay]; + // 预发当前正在刷新中时调用本方法使得header insert回置失败 + if (self.state != MJRefreshStateRefreshing) { + self.state = MJRefreshStateWillRefresh; + // 刷新(预防从另一个控制器回到这个控制器的情况,回来要重新刷新一下) + [self setNeedsDisplay]; + } } }