首页 > 其他 > 详细

UITableViewCell

时间:2014-12-10 15:53:51      阅读:159      评论:0      收藏:0      [点我收藏+]

1.设置背景

 cell.backgroundColor = D_cellColor2;             //错误做法
 cell.contentView.backgroundColor = D_cellColor2; //正确做法        

2. 重用单元格注意问题

 GoodsListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reusableCellIdentifier];
    if (cell == nil) {
        NSArray *nibArr = [[NSBundle mainBundle] loadNibNamed:@"GoodsListTableViewCell" owner:self options:nil];
        cell = (GoodsListTableViewCell *)[nibArr objectAtIndex:0];
        cell.selectionStyle = UITableViewCellSelectionStyleBlue;
    }
    //视图可以重用,但是数据还是要重新定义
    cell.goodsInfoVo = [_goodsInfoArray objectAtIndex:indexPath.row];

 

UITableViewCell

原文:http://www.cnblogs.com/apem/p/4155422.html

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