UI学习 第七章 UITableView每行的cell不同的设置
下中
Info为自定义类,内有属性
@property
(
nonatomic
,
strong
)
UIImageView
*newsImg;
@property ( nonatomic , strong ) UILabel *titleLabel;
@property ( nonatomic , strong ) UILabel *titleLabel;
@property
(
nonatomic
,
strong
)
UILabel
*subLabel;
下中为ViewController.m文件
- (
void
)viewDidLoad {
[
super
viewDidLoad
];
table = [[ UITableView alloc ] initWithFrame : self . view . bounds style : UITableViewStylePlain ];
table . delegate = self ;
table . dataSource = self ;
[ self . view addSubview : table ];
Info *info1 = [[ Info alloc ] init ];
info1. imageName = @"1" ;
info1. tittle = @"2" ;
info1. subTittle = @"3" ;
table = [[ UITableView alloc ] initWithFrame : self . view . bounds style : UITableViewStylePlain ];
table . delegate = self ;
table . dataSource = self ;
[ self . view addSubview : table ];
Info *info1 = [[ Info alloc ] init ];
info1. imageName = @"1" ;
info1. tittle = @"2" ;
info1. subTittle = @"3" ;