Jetpack Compose 点击涟漪效果的添加

463 阅读1分钟

只要在组件里添加两个属性 interactionSource, indication,这样点击时就有涟漪效果

Card(interactionSource = remember { MutableInteractionSource() },
    indication = rememberRipple(bounded = false),
    onClick = {
})

不想要点击效果

clickable(interactionSource = remember { MutableInteractionSource() },
    indication = null)