Android Ripple Effect Overridden by Selected State

后端 未结 3 624
伪装坚强ぢ
伪装坚强ぢ 2021-01-05 03:56

After having been looking for a while I\'ve not been able to find an answer to this...

I have a recycler view with items which when selected have a red background an

3条回答
  •  悲&欢浪女
    2021-01-05 04:43

    It will be better if you wrap your recyclerview item view in FrameLayout and set android:background="?selectableItemBackground" of FrameLayout and the child layout of FrameLayout background="@drawable/background"

    background.xml

    
    
    
    
    

    And then child layout must has attribute android:duplicateParentState="true"

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题