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

方法如下:
-
(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;
}
posted on 2013-03-02 15:15  tx天翔  阅读(1947)  评论(0编辑  收藏  举报