整数资源和形状Drawables

时间:2014-08-29 10:34:05

标签: android resources gradient shape

我试图通过整数资源为渐变对象提供不同的gradientRadius值,但它不会产生任何影响。没有绘制渐变。我们不能在xml中定义的形状中使用整数资源吗?我有两个位于values和values-land文件夹下的资源文件(integer.xml)。 gradient_radius对每个文件都有不同的值。

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >

    <corners android:radius="10dp" />

    <stroke
        android:width="6px"
        android:color="#FFFFFFFF" />

    <gradient
        android:endColor="#FFFDEDBE"
        android:centerColor="#CCE5D4AE"
        android:type="radial"
        android:gradientRadius="@integer/gradient_radius"
        android:startColor="#5568675A" />

</shape>

0 个答案:

没有答案