title: Rotate button about X-axis in an Android app
body: <p>I want to rotate a button about X-axis when clicked and then display a different image so it creates an effect that after button click it's flipping and showing a different image which is at its backside.</p>
  <p>I'm using following xml for rotation of button:</p>
  <pre><code>  &lt;set xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
   android:shareInterpolator=&quot;false&quot;&gt;
    &lt;set android:interpolator=&quot;@android:anim/decelerate_interpolator&quot;&gt;
  
    &lt;rotate 
           android:fromDegrees=&quot;0&quot; 
           android:toDegrees=&quot;-360&quot;
           android:pivotX=&quot;25%&quot;
           android:pivotY=&quot;25%&quot;
           android:fromXDelta=&quot;0&quot;
           android:toXDelta=&quot;0&quot;
           android:fromYDelta=&quot;0&quot;
           android:toYDelta=&quot;0&quot;             
           android:duration=&quot;400&quot; /&gt;
  &lt;/set&gt;
  &lt;/set&gt;
  </code></pre>
  <p>But it's rotating the button in 2-D plane about the button's center.</p>