Skip to content

Commit

Permalink
调整细节,修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiabob committed Dec 23, 2016
1 parent 733e6be commit f33ef95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Classes/LazyScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ - (void)reloadData {
[self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
[self.visibleViews removeAllObjects];

[self updateAllRects];
[self updateAllDatas];
}

- (void)enqueueReusableView:(UIView *)view {
Expand Down Expand Up @@ -158,12 +158,12 @@ - (void)registerClass:(Class)viewClass forViewReuseIdentifier:(NSString *)identi
#pragma mark - Utils

- (CGFloat)minEdgeOffset {
CGFloat min = self.contentOffset.y;
CGFloat min = CGRectGetMinY(self.bounds);
return MAX(min - kBufferSize, 0);
}

- (CGFloat)maxEdgeOffset {
CGFloat max = self.contentOffset.y + CGRectGetHeight(self.bounds);
CGFloat max = CGRectGetMaxY(self.bounds);
return MIN(max + kBufferSize, self.contentSize.height);
}

Expand Down Expand Up @@ -229,7 +229,7 @@ - (NSArray *)getVisiableViewModels {
return [self.allAscendingRectModels subarrayWithRange:NSMakeRange(firstIndex, lastIndex-firstIndex+1)];
}

- (void)updateAllRects {
- (void)updateAllDatas {
[self.allRectModels removeAllObjects];
self.allAscendingRectModels = nil;
self.allDescendingRectModels = nil;
Expand All @@ -241,7 +241,7 @@ - (void)updateAllRects {
[self.allRectModels addObject:model];
}

LSVRectModel *model = self.allRectModels.lastObject;
LSVRectModel *model = self.allAscendingRectModels.lastObject;
self.contentSize = CGSizeMake(CGRectGetWidth(self.bounds), CGRectGetMaxY(model.absRect));
}

Expand Down
10 changes: 5 additions & 5 deletions LazyScrollView/LazyScrollView/Classes/LazyScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ - (void)reloadData {
[self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
[self.visibleViews removeAllObjects];

[self updateAllRects];
[self updateAllDatas];
}

- (void)enqueueReusableView:(UIView *)view {
Expand Down Expand Up @@ -158,12 +158,12 @@ - (void)registerClass:(Class)viewClass forViewReuseIdentifier:(NSString *)identi
#pragma mark - Utils

- (CGFloat)minEdgeOffset {
CGFloat min = self.contentOffset.y;
CGFloat min = CGRectGetMinY(self.bounds);
return MAX(min - kBufferSize, 0);
}

- (CGFloat)maxEdgeOffset {
CGFloat max = self.contentOffset.y + CGRectGetHeight(self.bounds);
CGFloat max = CGRectGetMaxY(self.bounds);
return MIN(max + kBufferSize, self.contentSize.height);
}

Expand Down Expand Up @@ -229,7 +229,7 @@ - (NSArray *)getVisiableViewModels {
return [self.allAscendingRectModels subarrayWithRange:NSMakeRange(firstIndex, lastIndex-firstIndex+1)];
}

- (void)updateAllRects {
- (void)updateAllDatas {
[self.allRectModels removeAllObjects];
self.allAscendingRectModels = nil;
self.allDescendingRectModels = nil;
Expand All @@ -241,7 +241,7 @@ - (void)updateAllRects {
[self.allRectModels addObject:model];
}

LSVRectModel *model = self.allRectModels.lastObject;
LSVRectModel *model = self.allAscendingRectModels.lastObject;
self.contentSize = CGSizeMake(CGRectGetWidth(self.bounds), CGRectGetMaxY(model.absRect));
}

Expand Down

0 comments on commit f33ef95

Please sign in to comment.