File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -120,16 +120,17 @@ - (void)setState:(MJRefreshState)state
120120 self.pullingPercent = 0.0 ;
121121 }];
122122 } else if (state == MJRefreshStateRefreshing) {
123- [UIView animateWithDuration: MJRefreshFastAnimationDuration animations: ^{
124- // 增加滚动区域
125- CGFloat top = self.scrollViewOriginalInset .top + self.mj_h ;
126- self.scrollView .mj_insetT = top;
127-
128- // 设置滚动位置
129- self.scrollView .mj_offsetY = - top;
130- } completion: ^(BOOL finished) {
131- [self executeRefreshingCallback ];
132- }];
123+ dispatch_async (dispatch_get_main_queue (), ^{
124+ [UIView animateWithDuration: MJRefreshFastAnimationDuration animations: ^{
125+ CGFloat top = self.scrollViewOriginalInset .top + self.mj_h ;
126+ // 增加滚动区域top
127+ self.scrollView .mj_insetT = top;
128+ // 设置滚动位置
129+ [self .scrollView setContentOffset: CGPointMake (0 , -top) animated: NO ];
130+ } completion: ^(BOOL finished) {
131+ [self executeRefreshingCallback ];
132+ }];
133+ }];
133134 }
134135}
135136
You can’t perform that action at this time.
0 commit comments