码迷,mamicode.com
首页 > 其他好文 > 详细

设置tableView 的Section的title问题

时间:2015-11-21 11:43:43      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 15, 300, 60)];
    titleLabel.text = _dictData.allKeys[section];
    NSLog(@"%@",titleLabel.text);
    titleLabel.textColor = [UIColor lightGrayColor];
    titleLabel.font = [UIFont systemFontOfSize:15];
    NSLog(@"%ld",section);
    return titleLabel;
}

上面的代码是从带二个开始显示的,第一组没有

下面的代码是从头开始显示的

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
    return _dictData.allKeys[section];
}

 

设置tableView 的Section的title问题

标签:

原文地址:http://www.cnblogs.com/fanwenzheIOS/p/4983228.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!