android - ImageView 的原生圆形波纹效果

标签 android kotlin ripple

我想要为我的 ImageView 添加原生圆形波纹效果。我使用了“selectableItemBackgroundBorderless”,但波纹效果出现在方框中。检查下面的代码以供引用。提前致谢!!

 <ImageView
                android:id="@+id/ivAnswerListDownVote"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp_8"
                android:clickable="true"
                android:focusable="true"
                android:foreground="?attr/selectableItemBackgroundBorderless"
                android:src="@drawable/ic_outline_thumb_down_alt_24"
                tools:targetApi="m" />

最佳答案

你应该使用

android:background="?attr/selectableItemBackgroundBorderless"

关于android - ImageView 的原生圆形波纹效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64151294/

相关文章:

java - 将 fragment 作为参数传递给 RecyclerView.Adapter 是一种不好的做法吗?帮助点击

java - 如何将函数应用于列表列表

java - "sdk platform tools component is missing”

android - 将 gradle 版本更新到 5.1.1,但 kapt 不起作用

旋转设备时,日语语言环境中带有 TimePicker 对象的 Android Activity 崩溃

android - Lollipop RippleDrawable 与 Pre-Lollipop 的选择器

ios - 需要在 iOS 应用程序上挥舞旗帜效果

cordova - 无法使用带有涟漪模拟器的 Facebook 插件

java - 时间作为 SQL 的关键导致错误

java - Android4.0.3源码编译错误: [out/target/product/generic/obj/STATIC_LIBRARIES/libext_intermediates/initext.o]错误1