Effect button pressed in android studio

0

I have 4 buttons and I want to give everyone a pressed effect but I would like to know if I can create 4 different codes in a single Resource File or I have to create 4 Resource Files for each button this is the code of a resource file that bears the name "animaboton.xml"

<?xml version="1.0" encoding="utf-8"?>

<item android:drawable="@drawable/btnpress" android:state_pressed="true"></item>
<item android:drawable="@drawable/btnsinpress"></item>


in the XML I send it to call% android:background="@drawable/animaboton"

    
asked by sasuke uchia 18.06.2018 в 05:59
source

1 answer

0

Once the Resourse file has been created you just have to call the android:background="@drawable/animaboton" in the buttons you want

    
answered by 04.11.2018 в 06:07