How to create ripple effect in simple layout

前端 未结 10 1647
耶瑟儿~
耶瑟儿~ 2020-12-02 06:06

How can I have a ripple effect in a simple linear/relative layout when touching the layout?

I\'ve tried setting the background of a layout to something like:

10条回答
  •  攒了一身酷
    2020-12-02 06:26

    Simply add default ripple effect with android:background="?selectableItemBackground"

    Like:

    
    
               ...
    
    
    

提交回复
热议问题