Я создал пользовательский UITableViewHeaderFooterView и успешно загрузить с СИБ в моей UITableView, но всегда получить это сообщениеUITableViewHeaderFooterView не может изменить пользовательские фона при загрузке с кончика пера
«Установка цвета фона на UITableViewHeaderFooterView БЫЛА Не рекомендуется использовать contentView.backgroundColor. "
Вот код для загрузки мои пользовательские UITableViewHeaderFooterView:
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
KTHeaderFooterViewIphone customHeaderIphone* = [[[NSBundle mainBundle] loadNibNamed:@"KTHeaderFooterViewIphone" owner:self options:nil] objectAtIndex:0];
customHeaderIphone.tintColor = [UIColor whiteColor]; // this code worked, but the message above always show
customHeaderIphone.contentView.backgroundColor = [UIColor redColor]; // this code doesn't work, nothing's happened
customHeaderIphone.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"customHeader.png"]]; // this code doesn't work too, I can't change custom background image
return customHeaderIphone;
}
Установите цвет фона по умолчанию, чтобы он работал как шарм, спасибо u: D – HoangNA