Browse Source

完善刷新完毕后的效果

MJ Lee 11 years ago
parent
commit
78f4f653a6

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


+ 7 - 4
MJRefreshExample/MJRefreshExample/MJRefresh/MJRefreshBaseView.m

@@ -213,19 +213,22 @@ - (void)setState:(MJRefreshState)state
 		case MJRefreshStateNormal: // 普通状态
         {
             if (self.state == MJRefreshStateRefreshing) {
-                [UIView animateWithDuration:MJRefreshSlowAnimationDuration * 0.4 animations:^{
+                [UIView animateWithDuration:MJRefreshSlowAnimationDuration * 0.6 animations:^{
                     self.activityView.alpha = 0.0;
                 } completion:^(BOOL finished) {
                     // 停止转圈圈
                     [self.activityView stopAnimating];
                     
-                    // alpha
+                    // 恢复alpha
                     self.activityView.alpha = 1.0;
                 }];
                 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MJRefreshSlowAnimationDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-                    // 显示箭头
-                    self.arrowImage.hidden = NO;
+                    // 再次设置回normal
+                    _state = MJRefreshStatePulling;
+                    self.state = MJRefreshStateNormal;
                 });
+                // 直接返回
+                return;
             } else {
                 // 显示箭头
                 self.arrowImage.hidden = NO;