首页 > 移动平台 > 详细

IOStableviewsectionSet

时间:2015-07-24 22:31:41      阅读:261      评论:0      收藏:0      [点我收藏+]
- (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;
}

IOStableviewsectionSet

原文:http://www.cnblogs.com/wcLT/p/4674917.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!