Skip to content

UITableViewCell

UITableViewCell 继承自 UIView,用于在 UITableView 中展示一行内容。插件运行时暴露了常用的 label/imageView 以及与表格关联的辅助字段。

属性类型说明
contentViewUIView只读。内容容器。
textLabelUILabel只读。主标题 label。
detailTextLabelUILabel只读。副标题 label。
imageViewUIImageView只读。左侧图片视图。
backgroundViewUIView | null背景视图。
selectedBackgroundViewUIView | null选中态背景视图。
accessoryViewUIView | null自定义 accessory view。
accessoryTypenumberaccessory 类型。
editingAccessoryTypenumber编辑态 accessory 类型。
selectionStylenumber选中样式。
indentationLevelnumber缩进级别。
indentationWidthnumber缩进宽度。
selectedboolean是否选中。
highlightedboolean是否高亮。
editingboolean是否编辑态(运行时注释为未完全实现)。
showingDeleteConfirmationboolean只读。是否显示删除确认(运行时注释为未完全实现)。
reuseIdentifierstring只读。复用标识符。
tintColorUIColor | nulltintColor。
showsReorderControlboolean是否显示重排控制(运行时注释为默认值相关)。
multiSelViewUIImageView只读。多选视图。
indexPathNSIndexPath | null运行时附带的 indexPath(便于回调定位)。
tableViewUITableView | null运行时附带的 tableView 引用。
方法参数返回值说明
prepareForReuse()void复用前清理状态。
setSelectedAnimated(selected, animated)selected: boolean, animated: booleanvoid设置选中(可动画)。
setHighlightedAnimated(highlighted, animated)highlighted: boolean, animated: booleanvoid设置高亮(可动画)。
setEditingAnimated(editing, animated)editing: boolean, animated: booleanvoid设置编辑态(可动画)。
方法参数返回值说明
makeWithStyleReuseIdentifier(style, reuseIdentifier)style: number, reuseIdentifier: stringUITableViewCell创建 cell(常用于不走注册/复用时的手动创建)。
头文件 API 清单

正在加载…

协议:,来源: