Przeglądaj źródła

1.修改Apex Mobile Refresh Footer位置。

Pen Li 8 lat temu
rodzic
commit
ad368030b5
1 zmienionych plików z 13 dodań i 8 usunięć
  1. 13 8
      common/customUI/Refresh/Footer/JLRefreshFooter.m

+ 13 - 8
common/customUI/Refresh/Footer/JLRefreshFooter.m

@@ -84,6 +84,15 @@ CGFloat const JLRefreshFooterHeight = 30;
     
     
 }
 }
 
 
+- (void)updateTop {
+    
+    if (self.scrollView.jl_ContentHeight  > self.scrollView.jl_height) {
+        self.jl_y = self.scrollView.jl_ContentHeight ;
+    } else {
+        self.jl_y = self.scrollView.jl_height;
+    }
+}
+
 - (void)willMoveToSuperview:(UIView *)newSuperview {
 - (void)willMoveToSuperview:(UIView *)newSuperview {
     
     
     [super willMoveToSuperview:newSuperview];
     [super willMoveToSuperview:newSuperview];
@@ -93,8 +102,10 @@ CGFloat const JLRefreshFooterHeight = 30;
         self.scrollView.jl_insetBottom += self.jl_height;
         self.scrollView.jl_insetBottom += self.jl_height;
         
         
 //        self.jl_y = self.scrollView.jl_ContentHeight;
 //        self.jl_y = self.scrollView.jl_ContentHeight;
+        
         // 设置位置
         // 设置位置
-        self.jl_y = (((int)(self.scrollView.jl_ContentHeight / self.scrollView.jl_height)) + 1) * self.scrollView.jl_height;
+        [self updateTop];
+        
     
     
     } else { // remove
     } else { // remove
         
         
@@ -110,13 +121,7 @@ CGFloat const JLRefreshFooterHeight = 30;
     
     
 //    self.jl_y = self.scrollView.jl_ContentHeight;
 //    self.jl_y = self.scrollView.jl_ContentHeight;
     // 设置位置
     // 设置位置
-//    if (self.scrollView.jl_ContentHeight >= self.scrollView.jl_height) {
-//        self.jl_y = self.scrollView.jl_ContentHeight;
-//    } else {
-//        self.jl_y = self.scrollView.jl_height;
-//    }
-    
-    self.jl_y = (((int)(self.scrollView.jl_ContentHeight / self.scrollView.jl_height)) + 1) * self.scrollView.jl_height;
+    [self updateTop];
     
     
     if (self.offsetBlock) {
     if (self.offsetBlock) {
         self.offsetBlock(0);
         self.offsetBlock(0);