天天看点

Android textview的涟漪效果

本文档为个人博客文档系统的备份版本、作者:小游、作者博客:点击访问

虽然安卓有自带的,但是我想要那种网易云的那种圆形的效果。

最后我使用了一个库

https://github.com/lygttpod/SuperTextView

emm,最简单的模仿网易云的方案。

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="#FF0000"
    android:radius="20dp">
</ripple>
           

自己定义(我里面自己定义了一个园)

<ripple   xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="#000000">
    <item>
        <shape android:shape="oval">
            <size
                android:height="10dp"
                android:width="10dp">
            </size>
            <solid> </solid>
            <solid android:color="@color/s_transplant"/>
        </shape>
    </item>
</ripple>
           

参考文章

https://blog.csdn.net/gu18168/article/details/56290221

https://blog.csdn.net/Fantistic_baby/article/details/92839611

https://blog.csdn.net/kong92917/article/details/54291124

https://www.jianshu.com/p/8f0f6cd0c85d

继续阅读