IOS-UITableView手动添加时,Header Section的背景设置

来源:互联网 发布:小时候吃过的饼干知乎 编辑:程序博客网 时间:2024/05/16 01:34
方法如下:-(UIView*) tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section {UIView*headerView =[[[UIView alloc] initWithFrame:CGRectMake(0,0, tableView.bounds.size.width,30)] autorelease];if(section == integerRepresentingYourSectionOfInterest)[headerView setBackgroundColor:[UIColor redColor]];else[headerView setBackgroundColor:[UIColor clearColor]];return headerView;}
原创粉丝点击