//设置每一个分区的顶部自定义视图
- (UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section
{
UIView*view = [[UIViewalloc]initWithFrame:CGRectMake(0,0,tableView.frame.size.width,40)];
view.backgroundColor= [UIColorwhiteColor];
UIView*view1 = [[UIViewalloc]initWithFrame:CGRectMake(0,50,tableView.frame.size.width,1)];
view1.backgroundColor=RGBACOLOR(242,242,242,1);
UILabel*text = [[UILabelalloc]initWithFrame:CGRectMake(15,8,MSW,40)];
text.font= [UIFontsystemFontOfSize:15];
text.textColor=RGBACOLOR(51,51,51,1);
[viewaddSubview:text];
[viewaddSubview:view1];
if(section ==2) {
text.text=@"我的圈子";
}elseif(section ==3){
text.text=@"更多感兴趣的圈子";
}else{
returnnil;
}
returnview;
}
最后!欢迎加入iOS技术大群,学习知识交更多的同行朋友 QQ群号:580284575
网友评论