【发布时间】:2013-05-18 10:19:05
【问题描述】:
我想要一些类似 CSS 渐变的效果
-webkit-gradient(linear, left top, left bottom, color-stop(0%,#f0b7a1), color-stop(50%,#8c3310), color-stop(51%,#752201), color-stop(100%,#bf6e4e));
我的 android xml 可绘制代码如下:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="@color/transparent"
android:centerColor="#33b5e5"
android:endColor="@color/transparent"
android:angle="90"/>
</shape>
所以我想要实现的是添加这样的百分比:
<gradient
android:startColor="@color/transparent"
android:25%="#09c"
android:centerColor="#33b5e5"
android:75%="#09c"
android:endColor="@color/transparent"
android:angle="90"/>
我可以用什么方法吗?
【问题讨论】:
-
您终于找到了实现这一目标的方法吗?
标签: android css drawable gradient