首页 > 其他 > 详细

创建纯洁的TableViewCell

时间:2015-10-06 10:16:55      阅读:283      评论:0      收藏:0      [点我收藏+]

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

    //    声明静态字符串型对象,用来标记重用单元格

    static NSString *str = @"TableSampleIdentifier";

    //    用TableSampleIdentifier表示需要重用的单元

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:str];

    //    如果如果没有多余单元,则需要创建新的单元

    if (cell == nil) {

        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:str];

    }

 

    //    填充行的详细内容

    cell.detailTextLabel.text = @"详细内容";

    

    //    表视图单元提供的UILabel属性,设置字体大小

    cell.textLabel.font = [UIFont boldSystemFontOfSize:40.0f];

 

    //    设置单元格UILabel属性背景颜色

    cell.textLabel.backgroundColor=[UIColor clearColor];

 

    return cell;

}

 

创建纯洁的TableViewCell

原文:http://www.cnblogs.com/yyj900165/p/4856708.html

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