我剛剛實現了一個加載更多按鈕到我的tableView的頁腳,但頁腳始終與表滾動。我的tableView的風格是UITableViewStylePlain。TableView頁腳滾動表
請你能告訴我我哪裏出錯了。
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIView *footerView = nil;
if(footerView == nil) {
footerView = [[[UIView alloc] init] autorelease];
footerView.backgroundColor = [UIColor clearColor];
UIButton *button = [[UIButton alloc] init];
button.layer.cornerRadius = 7;
[button setFrame:CGRectMake(10, 3, 300, 44)];
[button setTitle:@"Load 20 more" forState:UIControlStateNormal];
[button.titleLabel setFont:[UIFont boldSystemFontOfSize:20]];
[button setBackgroundColor:[UIColor whiteColor]];
[button.titleLabel setTextColor:[UIColor blackColor]];
[button addTarget:self action:@selector(load20More) forControlEvents:UIControlEventTouchUpInside];
[footerView addSubview:button];
[button release];
}
if ([songInfo count] > 20 && count < 100) {
return footerView;
}
else
return nil;
}
當您按加載更多時,您想要發生什麼? – Cyprian 2011-05-08 18:50:06
加載更多工作完美,並且不會影響tableView的頁腳與表格的滾動。 – 2011-05-08 19:16:33