我想知道是否有一种工具可以生成xml选择器文件,用于自定义按钮。我已经厌倦了创建按钮、将它们转换为.9.png文件,然后复制并粘贴自定义选择器到xml中...
我知道这些工具:
http://www.androidicongenerator.net/
http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html
虽然它们在生成资产/资源方面非常方便,但我错过了选择4个图像并生成一个可直接使用的选择器xml的选项,其输出类似于:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- pressed -->
<item android:state_pressed="true" android:background="@drawable/img_pressed" />
<!-- focused -->
<item android:state_focused="true" android:background="@drawable/img_focussed" />
<!-- default -->
<item android:background="@drawable/img_default" />
</selector>
我正在考虑自己创建一个,但无法相信还没有人已经这样做了 :)
谢谢