MJLee 11 лет назад
Родитель
Сommit
78e64de692

BIN
MJRefreshExample/MJRefreshExample.xcodeproj/project.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate


+ 7 - 1
MJRefreshExample/MJRefreshExample/MJRefresh/MJRefreshHeaderView.m

@@ -198,7 +198,13 @@ - (void)setState:(MJRefreshState)state
                 
                 [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{
 #warning 这句代码修复了,top值不断累加的bug
-                    self.scrollView.mj_contentInsetTop -= self.mj_height;
+                    if (self.scrollViewOriginalInset.top == 0) {
+                        self.scrollView.mj_contentInsetTop = 0;
+                    } else if (self.scrollViewOriginalInset.top == self.scrollView.mj_contentInsetTop) {
+                        self.scrollView.mj_contentInsetTop -= self.mj_height;
+                    } else {
+                        self.scrollView.mj_contentInsetTop = self.scrollViewOriginalInset.top;
+                    }
                 }];
             } else {
                 // 执行动画