Touch feedback with RecyclerView and CardView

前端 未结 10 761
一向
一向 2020-12-07 09:32

I would love to enable touch feedback for my Open-Source library.

I\'ve created a RecyclerView and a CardView. The CardView co

10条回答
  •  旧巷少年郎
    2020-12-07 10:26

    You have to add following lines in the layout that you are using under CardView

    android:clickable="true"
    android:focusable="true"
    android:background="@drawable/my_ripple"
    

    Example

    
    
    
    

提交回复
热议问题