Как добавить нижний колонтитул в UITableView? - PullRequest
53 голосов
/ 28 февраля 2011

Я использую этот код для добавления нижнего колонтитула в 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

Ответы [ 11 ]

0 голосов
/ 04 июля 2016

Если вы не предпочитаете эффект липкого дна, я бы поставил его в viewDidLoad() https://stackoverflow.com/a/38176479/4127670

...