14
这是我想做的事:我有这种规模的xml:Android:是否可以缩放xml drawable?
<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/mydrawable"
android:scaleGravity="bottom"
android:scaleHeight="50%" />
而且我想这个可绘制XML使用它:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#FFFFFFFF"
android:endColor="#FFFF0000"
android:angle="90" />
</shape>
</item>
</layer-list>
然后我设置比例XML作为背景对于LinearLayout,但我什么都看不到。我是否错过了一些东西,或者不可能这样做(使用XML)?
顺便说一句顶层元素可以是'shape'而不需要一个图层列表来包围它。另外,哪些资源目录是这些文件? – Greyson
对不起,我刚刚意识到我很晚才进入这个_extremely_。 – Greyson
@michelemarcon:你最终得到了什么? – Behnam