Android L's Ripple Effect - Touch Feedback for Buttons - Using XML

前端 未结 7 1525
青春惊慌失措
青春惊慌失措 2020-11-27 11:13

I am trying to understand how to implement the \"Ripple Effect - Touch Feedback\" for buttons and other views. I looked at the questions related to Ripple touch effect on SO

相关标签:
7条回答
  • 2020-11-27 12:10

    Just put ?attr/selectableItemBackground in the background of button for API 21+ , like below:

    <Button
            android:layout_width="match_parent"
            android:layout_height="70dp"
            android:background="?attr/selectableItemBackground"
            android:text="Button" />
    
    0 讨论(0)
提交回复
热议问题