selectableItemBackgroundBorderless for textview

前端 未结 2 1882
暖寄归人
暖寄归人 2021-02-14 10:26

I have a TextView which is use as a button. I want to add attribute selectableItemBackgroundBorderless to have circle ripple effect when pressing. The

相关标签:
2条回答
  • 2021-02-14 10:31

    1.To limit the ripple effect inside the view only you need to specify

    android:background="?attr/selectableItemBackground"
    

    inside the view.

    2.For making ripple effect border less i.e show ripple effect in whole layout you can use this.

    android:background="?attr/selectableItemBackgroundBorderless"
    

    3.For more you can check the link Defining Custom Animation

    0 讨论(0)
  • 2021-02-14 10:44

    You have to use ?android:attr/selectableItemBackground to keep the ripple effect inside the View boundaries.

    ?android:attr/selectableItemBackgroundBorderless allows the effect to go outside of the View.

    0 讨论(0)
提交回复
热议问题