title: How do I set a "pressed" imagebutton in Android Studio?
body: <p>I have an ImageButton:</p>
  
  <pre><code>&lt;ImageButton
      android:layout_width="60dp"
      android:layout_height="60dp"
      android:id="@+id/btn_70s"
      android:src="@drawable/btn_70s"
      android:background="@null" /* Sets transparent BG for button image(PNG) */
   /&gt;
  </code></pre>
  
  <p>The image is "btn_70s", how do I set a "pressed" version of the image for when the ImageButton is tapped? </p>
  
  <p>The documentation states to create an XML file and place it in the drawable directory:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
   &lt;item android:state_pressed="true"
         android:drawable="@drawable/button_pressed" /&gt; &lt;!-- pressed --&gt;
   &lt;item android:state_focused="true"
         android:drawable="@drawable/button_focused" /&gt; &lt;!-- focused --&gt;
   &lt;item android:drawable="@drawable/button_normal" /&gt; &lt;!-- default --&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>This to me says it would affect all the ImageButtons rather than an individual one. Would I save it as an individual XML for each button for example (btn_70s_custom.xml), and then use it like:</p>
  
  <pre><code>&lt;ImageButton
      android:layout_width="60dp"
      android:layout_height="60dp"
      android:id="@+id/btn_70s"
      android:src="@drawable/btn_70s"
      android:android:background="@drawable/btn_70s_custom"
   /&gt;   
  </code></pre>
  
  <p>Only issue with this, I can't use @null to allow transparency. Any assistance is appreciate.</p>