我使用此代码向 TableView 添加页脚。它有 20 个部分,每个部分有几行。有一个 titleForHeaderInSection 和sectionForSectionIndexTitle 方法。
CGRect footerRect = CGRectMake(0, 0, 320, 40);
UILabel *tableFooter = [[UILabel alloc] initWithFrame:footerRect];
tableFooter.textColor = [UIColor blueColor];
tableFooter.backgroundColor = [self.theTable backgroundColor];
tableFooter.opaque = YES;
tableFooter.font = [UIFont boldSystemFontOfSize:15];
tableFooter.text = @"test";
self.theTable.tableFooterView = tableFooter;
[tableFooter release];
我做错了什么?
谢谢
RL
最佳答案
我在我的代码中特别看到
self.theTable.tableFooterView = tableFooter;
作品和
[self.theTable.tableFooterView addSubview:tableFooter];
不起作用。因此,坚持前者并在其他地方寻找可能的错误。 HTH
关于iphone - 如何向 UITableView 添加页脚?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5144835/