From what I′ve tested, the %
does work, but not as you expected.
First of all
android:gradientRadius="50"
seems to take the value as pixels 50px
android:gradientRadius="50%"
is converted as if 50% = 0.5 px, try
android:gradientRadius="5000%"
and you will see a 50px radius.
Using %p
has a similar result. Obviously this is something I hope will be changed in the future, because it does not have much use as it is. Usually XML ShapeDrawable resources adapt their size to some external container, in this case gradientRadius
is setting the size regardless of the container.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…