不知道大家有没有出现过 cell 上属性不现实的状况,今天遇到了,在网上查找了一下,记录下来。
UITableViewCell 在初始化时,style;
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIndentify];
}
typedef NS_ENUM(NSInteger, UITableViewCellStyle) {
UITableViewCellStyleDefault,
UITableViewCellStyleValue1,
UITableViewCellStyleValue2,
UITableViewCellStyleSubtitle
};
当style样式不同时,就会显示不同属性:
特举例子:cell 为UITableViewCellStyleSubtitle 样式时;
显示属性:detailTextLable .