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