【发布时间】:2011-07-05 21:57:46
【问题描述】:
我正在使用此代码向 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];
我做错了什么?
谢谢,
强化学习
【问题讨论】:
-
你看到了什么?这段代码是
viewForFooterInSection:还是其他方法? -
@BoltClock 页脚中没有任何内容。例如,该代码在 viewDidLoad 中。
-
@Rui:要制作节页脚,请实现
viewForFooterInSection:。创建一个视图,并在委托方法中返回该视图。 -
@BoltClock 页脚用于表格,而不是表格的最后一部分。我实现该方法以便获得页脚?我在其他视图中也有相同的方式,不同之处在于我只有 1 个部分。谢谢,RL
-
@BoltClock 页脚用于表格。上面的代码适用于另一个表,但它只有一个部分。为什么?
标签: iphone uitableview uiview footer