使用xib自定义Cell
来源:互联网 发布:知乎台湾男生 编辑:程序博客网 时间:2024/04/29 13:09
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//"myCell"为复用的名字
UITableViewCell *cell = [tableViewdequeueReusableCellWithIdentifier:@"myCell"];
if (cell == nil) {
//"myCell"为xib的名字
cell = [[[NSBundlemainBundle] loadNibNamed:@"myCell"owner:selfoptions:nil]lastObject];
NSLog(@"创建");
}else{
NSLog(@"复用");
}
//number name moumou为xib上的UIlable控件
UILabel *number = (UILabel *)[cellviewWithTag:100];
number.text = [NSStringstringWithFormat:@"学号%d",indexPath.row];
UILabel *name = (UILabel *)[cellviewWithTag:101];
name.text = [NSStringstringWithFormat:@"姓名%d",indexPath.row];
UILabel *moumou = (UILabel *)[cellviewWithTag:102];
moumou.text = [NSStringstringWithFormat:@"某某%d",indexPath.row];
UIImageView *imageView = (UIImageView *)[cellviewWithTag:103];
imageView.image = [UIImageimageNamed:@"2.jpg"];
return cell;
}
- 使用xib自定义Cell
- 使用xib创建自定义Cell
- UICollectionView使用Xib自定义cell
- 使用xib定义一个自定义Cell
- 自定义等高的cell(使用XIB)
- Swift_ uitableview使用自定义(xib)cell
- IOS Tableview使用xib自定义cell
- 自定义cell 用xib
- xib 自定义cell
- 通过xib自定义cell
- iOS--xib自定义cell
- iOS ---xib自定义cell
- xib 自定义cell高度
- 通过xib自定义cell
- XIB自定义Cell重用问题
- xib 自定义Cell(一)
- xib 自定义 Cell(二)
- Xib自定义cell注意点
- 深入分析AsyncTask
- ASP.NET正式总结三
- Win7(64位)下安装Oracle 11g (图文解说版)
- AIDL笔记
- Mac OS X 背后的故事(一)力挽狂澜的Ellen Hancock
- 使用xib自定义Cell
- Jeally Bean中MonekyRunner 帮助文件
- 由in_array()函数引发的对PHP比较运算中自动转型的思考
- new web game server
- ASP.Net控件母版页专题
- 拥有大量特性的前端框架 - Maxmertkit
- Servlet 数据库连接 总结
- iPhone开发:延时实例化的使用
- ASP.Net之 ListView控件专题