小编mik*_*elo的帖子

父级或子级可组合触发器同时单击

我有一个父级可组合项

Row(
    modifier = modifier
        .width(tableWidth)
        .fillMaxHeight(),
) {
    cells.forEachIndexed { it1, cell ->
        Column(
            modifier = Modifier
                .height(tableHeight),
        ) {
            for (i in cell.indices) {
                Box(
                    modifier = Modifier
                        .width(sideBarWidth)
                        .height(headerHeight)
                        .clickable {
                          //event here
                        }
                ) {
                    eventContent(
                        studentScore =  cell,
                        listIndex = it1,
                        index = i,
                        onEvent = onEvent // event here
                    )
                }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

和一个子级,它是 eventContent 可组合项,如上所示。

我希望父可组合项或子可组合项触发两个单击事件。我怎样才能做到这一点?

android callback kotlin android-jetpack-compose

5
推荐指数
1
解决办法
1342
查看次数