您的位置:首页 > 产品设计 > UI/UE

用.xib文件自定义UITableViewCell

2015-03-19 13:30 197 查看
1.选中Table View Cell,打开Attribute Inspector,将Identifier设置为CustomCellIdentifier:

2.在cell生成函数中输入:

static NSString *CustomCellIdentifier = @"CustomCellIdentifier";

static BOOL nibsRegistered = NO;
if (!nibsRegistered) {
UINib *nib = [UINib nibWithNibName:@"CustomCell" bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:CustomCellIdentifier];
nibsRegistered = YES;
}

CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CustomCellIdentifier];

return cell;


详情:http://www.howzhi.com/group/iosDevelop/discuss/2068
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: