如何以编程方式将基本页脚设置为UITableView?
只是一个居中的文字?
编辑:
如何设置条形颜色并将页脚栏位置固定在屏幕底部,或者如果大拇指没有填满屏幕,则页脚不会位于屏幕底部之上。
答案 0 :(得分:10)
viewForFooterInSection设置部分的页脚。要设置表格的页脚,您需要设置
self.tableView.tableFooterView = myCustomFooterView
其中myCustomFooterView是您在别处设置的内容。你可能在viewDidLoad中设置它。
答案 1 :(得分:8)
您可以使用UITableViewDataSource回调(只是文本):
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
或UITableViewDelegate(您喜欢的任何自定义视图):
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section