How can I modify ripple color when using ?attr/selectableItemBackground as background?

前端 未结 8 1308
情深已故
情深已故 2020-11-28 18:22

I\'ve seen some SO questions and they gave some possible methods to achieve what I want. For example:

  1. Use colorControlHighlight attribute in st

8条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 18:58

    Use the foreground attribute as selectableItemBackground and background attribute as the color you want.

    android:foreground="?attr/selectableItemBackground"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:background="@color/white"
    

提交回复
热议问题