我想在xml中为按钮的背景翻转图像。我看过如何做这个的示例,但它是以编程方式实现的:http://xjaphx.wordpress.com/2011/06/26/image-processing-image-flipping-mirroring。 无论如何,我有一个如下的xml文件(button_left_state.xml):
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/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" />
</item>
<item>
<rotate android:fromDegrees="180.0" android:toDegrees="0.0"
android:pivotX="50%" android:pivotY="50%" android:drawable="@drawable/buttonright"/>
</item>
</selector>
但是这段代码只能将图像旋转180度。在XML中是否有可能翻转图像?