Skip to content

Commit

Permalink
fix the error and loadMoreView status.
Browse files Browse the repository at this point in the history
  • Loading branch information
xhzengAIB committed Aug 7, 2014
1 parent 12eb068 commit a48e9b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions RefreshControl/Manager/XHRefreshControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@ - (BOOL)isLoadMoreRefreshed {
BOOL loadMored = YES;
if ([self.delegate respondsToSelector:@selector(isLoadMoreRefreshed)]) {
loadMored = [self.delegate isLoadMoreRefreshed];
self.loadMoreView.hidden = !loadMored;
return loadMored;
}
self.loadMoreView.hidden = !loadMored;
return loadMored;
}

Expand Down Expand Up @@ -617,8 +619,8 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
} else if ([keyPath isEqualToString:@"contentSize"]) {
if (self.isLoadMoreRefreshed && !self.noMoreDataForLoaded && !self.pullDownRefreshing) {
CGSize contentSize = [[change valueForKey:NSKeyValueChangeNewKey] CGSizeValue];
CGFloat scrollViewHeight = CGRectGetHeight(self.scrollView.frame);
CGFloat thubs = scrollViewHeight - [self getAdaptorHeight];
// CGFloat scrollViewHeight = CGRectGetHeight(self.scrollView.frame);
// CGFloat thubs = scrollViewHeight - [self getAdaptorHeight];
// if (contentSize.height >= thubs) {
CGRect loadMoreViewFrame = self.loadMoreView.frame;
loadMoreViewFrame.origin.y = contentSize.height;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ - (void)loadDataSource {
[self endLoadMoreRefreshing];
}
} else {

if (rand() % 3 > 1) {
self.loadMoreRefreshed = NO;
}

self.dataSource = dataSource;
[self.tableView reloadData];
[self endPullDownRefreshing];
Expand Down

0 comments on commit a48e9b8

Please sign in to comment.