【发布时间】:2021-06-23 11:24:18
【问题描述】:
在this 的回答中,我得到了错误的波纹动画。你知道如何使用 Jetpack Compose 创建圆角波纹吗?
使用默认波纹我有这个:
代码:
Card(shape = RoundedCornerShape(30.dp),
border = BorderStroke(width = 2.dp, color = buttonColor(LocalContext.current)),
backgroundColor = backColor(LocalContext.current),
modifier = Modifier
.fillMaxWidth()
.padding(10.dp)
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = rememberRipple(radius = 30.dp)
) { show = !show }
) { ... } //Show is animation of other element.
//如果我将波纹半径设置为 200 dp(这是卡片的高度),则波纹工作不正常。
【问题讨论】:
标签: android android-jetpack-compose ripple-effect