【发布时间】:2010-09-22 13:24:27
【问题描述】:
我正在使用此代码通过 UITableView 设置标题和背景颜色,但未显示标题?
- (NSString *)tableView:(UITableView *)aTableView titleForHeaderInSection:(NSInteger)section
{
return @"Contents";
}
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 30)] autorelease];
[headerView setBackgroundColor:[UIColor brownColor]];
[self.view sendSubviewToBack:headerView];
return headerView;
}
请帮忙...
【问题讨论】:
标签: ios uitableview