我想添加涟漪效果到一个视图,但它似乎不工作时,我添加

android:background="?android:attr/selectableItemBackgroundBorderless"

当我添加了

Android:background="?android:attr/selectableItemBackground"

It works with android 12 and older but not work with android 13 and newer. With android 13 and newer only Android:background="?android:attr/selectableItemBackground" is working, But I want the Ripple behavior of android:background="?android:attr/selectableItemBackgroundBorderless".

请帮帮忙.

谢谢你!

推荐答案

用这个android:background="?android:selectableItemBackgroundBorderless" 不是android:background="?android:attr/selectableItemBackground"

Android相关问答推荐

房间数据库迁移未正确处理:原因:java.lang. IllegalState异常:

合成 colored颜色 的GSON反序列化

如何从sqlite数据库中检索数据到碎片android?

在Jetpack Compose中实现焦点突出的最佳方式?

LaunchedEffect没有延迟时应用程序崩溃

解决失败:Landroidx/compose/runtime/PrimitiveSnapshotStateKt

使用 List 和 LazyColumn 重新组合所有项目

为什么 Android Studio 中的 theme.xml 目录没有任何原色

减少Compose中可滚动选项卡之间的间距

当 EditText 用于在 android studio 中将字符串发送到 firebase 时,仅允许安全调用错误

如何仅同步 local_manifest.xml?

服务似乎在启动时忽略传递的变量

如何将一个 Composable 作为其参数传递给另一个 Composable 并在 Jetpack Compose 中显示/运行它

如何使用 Jetpack Compose 在图像上叠加文本

如何在 TextButton 中分隔文本和图标

删除一对多关系室 Kotlin 中的所有值

从expose 的 dropdownMenu 可组合、jetpack 组合中 Select 选项时,不会触发文本字段的 onValueChange

android 13 版本是否会影响 android 12 目标应用程序

如何根据加载图像的 colored颜色 绘制边框?

如何在 flow.stateIn() 之后从流中的另一个函数发出emits ?