1.属性
imageView:图片视图
textLabel:文本标签
detailTextLabel:详细文本标签
contentView:内容视图
backgroundView:背景视图
selectedBackgroundView:选择视图
multipleSelectionBackgroundView:多选择情况下背景视图
reuseIdentifier: 重用标识符
selectionStyle:选中选中颜色 (一共有四种情况:UITableViewCellSelectionStyleNone,UITableViewCellSelectionStyleBlue,UITableViewCellSelectionStyleGray,UITableViewCellSelectionStyleDefault )
selected:是否能够选中
highlighted:高亮状态
editingStyle:编辑模式 (一共三种情况:UITableViewCellEditingStyleNone,UITableViewCellEditingStyleDelete,UITableViewCellEditingStyleInsert)
showsReorderControl:是否重新排列 (一般在编辑模式下面使用)
shouldIndentWhileEditing:编辑模式下是否需要对表视图指定行进行缩进
accessoryType:附件风格 (一共五种情况:UITableViewCellAccessoryNone, UITableViewCellAccessoryDisclosureIndicator,UITableViewCellAccessoryDetailDisclosureButton ,UITableViewCellAccessoryCheckmark, UITableViewCellAccessoryDetailButton)
accessoryView:附件视图 (可以根据自己的需求定义)
editingAccessoryType:编辑模式下附件风格
editingAccessoryView:编辑模式下附件视图
indentationLevel:文本缩进级别 (缩进几次,添加其他控件使原来空间大小不够用)
indentationWidth:每次缩进宽度
separatorInset:分割线样式
editing:是否能够编辑
showingDeleteConfirmation:是否目前正在显示删除按钮
focusStyle:单元格主要风格 (iOS9加入)
2.方法
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier;初始化cell
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder;反归档
- (void)prepareForReuse;cell被重用之后调用的方法
- (void)setSelected:(BOOL)selected animated:(BOOL)animated;点击cell的动画效果
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;设置高亮效果
- (void)setEditing:(BOOL)editing animated:(BOOL)animated;设置编辑模式
- (void)willTransitionToState:(UITableViewCellStateMask)state; cell状态将要转换时调用的函数
- (void)didTransitionToState:(UITableViewCellStateMask)state; cell状态已经转换时调用的函数