Yan*_*ick 4 android android-jetpack-compose
在 Jetpack Compose 中,clickableModifier 将默认使用LocalIndication.current并显示绑定到边框的波纹。这几乎总是看起来很棒,但在某些情况下,圆形、无约束的波纹看起来更好。回到 View Android,我们会用它android:background="?attr/selectableItemBackgroundBorderless来实现这种行为。我们如何在撰写中做到这一点?
示例[来源]:

您可以按如下方式自定义涟漪效果:
Modifier.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = rememberRipple(bounded = false), // You can also change the color and radius of the ripple
onClick = {}
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1121 次 |
| 最近记录: |