【发布时间】:2015-08-20 15:32:19
【问题描述】:
当用户在UITableView 的文本字段单元格中提供不正确的输入时,我想将页脚更改为带有彩色文本的警告,描述错误。除了着色之外,我已经让它完美地工作了。 我在下面的代码中做错了什么,导致文本没有着色?
- (UIView *) tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
switch (section)
{
// Inspection confirms this case is entered when needed.
case SECTION_VALIDATABLE_FORM:
{
UITableViewHeaderFooterView *warningFooter = [[UITableViewHeaderFooterView alloc] initWithReuseIdentifier:K_FOOTER_WARNING];
UIColor *color = [MyColors uiColorForKey:K_COLOR_TEXT_ERROR]; // inspection confirms this is the UIColor equivalent of #BB2222
[warningFooter.textLabel setTextColor:color];
return warningFooter;
}
// other sections...
}
return nil;
}
【问题讨论】:
标签: ios uitableview cocoa-touch