Procházet zdrojové kódy

Fix header problem

Fix header problem
MJLee před 10 roky
rodič
revize
22e53b3c64

+ 1 - 1
MJRefresh.podspec

@@ -1,6 +1,6 @@
 Pod::Spec.new do |s|
   s.name         = "MJRefresh"
-  s.version      = "1.4.1"
+  s.version      = "1.4.2"
   s.summary      = "The easiest way to use pull-to-refresh"
   s.homepage     = "https://github.com/CoderMJLee/MJRefresh"
   s.license      = "MIT"

+ 8 - 1
MJRefreshExample/MJRefreshExample/MJRefresh/MJRefreshHeader.m

@@ -266,7 +266,14 @@ - (void)setState:(MJRefreshHeaderState)state
                 
                 // 恢复inset和offset
                 [UIView animateWithDuration:MJRefreshSlowAnimationDuration delay:0.0 options:UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionBeginFromCurrentState animations:^{
-                    _scrollView.mj_insetT -= self.mj_h;
+//                    _scrollView.mj_insetT -= self.mj_h;
+                    if (_scrollViewOriginalInset.top == 0) {
+                        _scrollView.mj_insetT = 0;
+                    } else if (_scrollViewOriginalInset.top ==_scrollView.mj_insetT) {
+                        _scrollView.mj_insetT -= self.mj_h;
+                    } else {
+                        _scrollView.mj_insetT = _scrollViewOriginalInset.top;
+                    }
                 } completion:nil];
             }
             break;