UILabel *loadMoreText = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 116.0f, 40.0f)];
[loadMoreText setCenter:tableFooterView.center];
[loadMoreText setFont:[UIFont fontWithName:@"Helvetica Neue" size:14]];
[loadMoreText setText:@"上拉顯示更多數據"];
[tableFooterView addSubview:loadMoreText];
if(!_loadingMore && scrollView.contentOffset.y > ((scrollView.contentSize.height - scrollView.frame.size.height)))
{
NSLog(@"開始加載");
[self loadDataBegin];
}
{
if (_loadingMore == NO)
{
_loadingMore = YES;
UIActivityIndicatorView *tableFooterActivityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(75.0f, 10.0f, 20.0f, 20.0f)];
[tableFooterActivityIndicator setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray];
[tableFooterActivityIndicator startAnimating];
[searchTableView.tableFooterView addSubview:tableFooterActivityIndicator];
NSLog(@"正在加載");
[self loadDataing];
}
NSLog(@"加載完畢");
_loadingMore = NO;
[self createTableFooter];
}