标签:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ if (tableView == self.searchDisplayController.searchResultsTableView) { return nil; } UIView *headView = [[[UIView alloc]init]autorelease]; headView.backgroundColor = [UIColor clearColor]; if (section!=0) { //标题背景 UIView *biaotiView = [[[UIView alloc]init]autorelease]; biaotiView.backgroundColor = BB_White_Color; biaotiView.frame=CGRectMake(0, 0, 320, 30); [headView addSubview:biaotiView]; //标题文字 UILabel *lblBiaoti = [[[UILabel alloc]init]autorelease]; lblBiaoti.backgroundColor = [UIColor clearColor]; lblBiaoti.textAlignment = NSTextAlignmentLeft; lblBiaoti.font = [UIFont systemFontOfSize:15]; lblBiaoti.textColor = [UIColor blackColor]; lblBiaoti.frame = CGRectMake(15, 7.5, 200, 15); lblBiaoti.text = [headerList objectAtIndex:section-1]; [biaotiView addSubview:lblBiaoti]; } return headView;}标签:
原文地址:http://www.cnblogs.com/wcLT/p/4674917.html