Cell 单元格
介绍
单元格为列表中的单个展示项。
引入
代码演示
基础用法
Cell
可以单独使用,也可以与 CellGroup
搭配使用,CellGroup
可以为 Cell
提供外边框。
卡片风格
通过 CellGroup
的 inset
属性,可以将单元格转换为圆角卡片风格。
展示图标
通过 icon
属性在标题左侧展示图标。
展示箭头
设置 is-link
属性后会在单元格右侧显示箭头。
分组标题
通过 CellGroup
的 title
属性可以指定分组标题。
自定义布局
如以上用法不能满足你的需求,可以自定义布局内容。
垂直居中
通过 center
属性可以让 Cell
的左右内容都垂直居中。
API
Cell @Props
title
左侧标题
ResourceStr
否
value
右侧内容
ResourceStr
否
label
标题下方的描述信息
ResourceStr
否
icon
左侧图标名称
string
否
isLink
是否展示右侧箭头并开启点击反馈
boolean
否
false
bgColor
背景颜色
ResourceColor
否
Color.White
clickable
是否开启点击反馈
boolean
否
false
bordered
是否显示内边框
boolean
否
true
center
是否使内容垂直居中
boolean
否
false
CellGroup @Props
title
分组标题
ResourceStr
否
inset
是否展示为圆角卡片风格
boolean
否
false
bordered
是否显示外边框
boolean
否
true
bgColor
分组背景色
ResourceColor
否
Color.Transparent
Cell @BuilderParam
customTitle
自定义标题
customLabel
自定义描述信息
customValue
自定义右侧内容
customIcon
自定义标题前的图标
customRightIcon
自定义右侧图标
CellGroup @BuilderParam
customTitle
自定义分组标题
customContent
自定义分组内容区
Last updated