ソースを参照

修复了“头部控件一直往下走位”的bug

MJ Lee 11 年 前
コミット
1d1f44326b

+ 1 - 1
MJRefreshExample/MJRefreshExample.xcodeproj/project.xcworkspace/xcshareddata/MJRefreshExample.xccheckout

@@ -5,7 +5,7 @@
 	<key>IDESourceControlProjectFavoriteDictionaryKey</key>
 	<false/>
 	<key>IDESourceControlProjectIdentifier</key>
-	<string>40890427-7F66-493F-92C3-9C4EFE946E5F</string>
+	<string>99E97458-5B35-4FAB-9773-FAE0AB4AD62E</string>
 	<key>IDESourceControlProjectName</key>
 	<string>MJRefreshExample</string>
 	<key>IDESourceControlProjectOriginsDictionary</key>

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


+ 3 - 1
MJRefreshExample/MJRefreshExample/MJRefresh/MJRefreshFooterView.m

@@ -137,7 +137,9 @@ - (void)setState:(MJRefreshState)state
             if (MJRefreshStateRefreshing == oldState) {
                 self.arrowImage.transform = CGAffineTransformMakeRotation(M_PI);
                 [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{
-                    self.scrollView.mj_contentInsetBottom = self.scrollViewOriginalInset.bottom;
+//                    self.scrollView.mj_contentInsetBottom = self.scrollViewOriginalInset.bottom;
+#warning 这句代码修复了,bottom值不断累加的bug
+                    self.scrollView.mj_contentInsetBottom -= self.mj_height;
                 }];
             } else {
                 // 执行动画

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

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