Android – flip image in xml


I want to flip image for button's background in xml. I've seen example how to do it, but it was programmatically way:
Anyway, I have a xml file (button_left_state.xml) like below :

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="">  
<item android:state_pressed="true" >
    <rotate android:fromDegrees="180.0" android:toDegrees="180.0" 
    android:pivotX="50%" android:pivotY="50%" android:drawable="@drawable/buttonrightpressed" />    

  <rotate android:fromDegrees="180.0" android:toDegrees="0.0" 
    android:pivotX="50%" android:pivotY="50%" android:drawable="@drawable/buttonright"/>

But this code just rotate image to 180 degrees.
Is it possible to flip image in xml?

Best Solution

Use the scale attributes in ImageView

android:scaleX="-1" //To flip horizontally or
android:scaleY="-1" //To flip vertically