Cell
fun Cell(modifier: Modifier = Modifier, title: String, value: String = "", label: String = "", icon: @Composable () -> Unit? = null, border: Boolean = true, link: Boolean = false, required: Boolean = false, arrowDirection: CellArrowDirection = CellArrowDirection.RIGHT, onClick: () -> Unit? = null, afterTitle: @Composable () -> Unit? = null, afterValue: @Composable () -> Unit? = null)
单元格 列表中的基础行单元,支持标题、右侧内容、描述信息、图标、箭头链接及必填标记等
Parameters
modifier
Modifier 修饰符
title
String 左侧标题文字
value
String 右侧内容文字,为空时不显示,默认为空
label
String 标题下方的描述信息,为空时不显示,默认为空
icon
@Composable (() -> Unit)? 标题左侧图标,为 null 时不显示,默认 null
border
Boolean 是否在底部显示分割线,默认 true
link
Boolean 是否显示右侧箭头并将整行作为可点击区域,需同时设置 onClick,默认 false
required
Boolean 是否在标题左侧显示红色必填星号 (*),默认 false
arrow Direction
CellArrowDirection 右侧箭头的方向,仅在 link 为 true 时生效,默认 CellArrowDirection.RIGHT
on Click
(() -> Unit)? 整行点击回调,为 null 时不响应点击,默认 null
after Title
@Composable (() -> Unit)? 紧跟在标题文字后面插入的自定义内容,默认 null
after Value
@Composable (() -> Unit)? 紧跟在右侧内容后、箭头前插入的自定义内容,默认 null