【发布时间】:2012-12-17 17:48:27
【问题描述】:
我有一个顶部带有标签的屏幕。这个标签是用 TextView 完成的。 作为背景,我想要一个垂直渐变,从 color1 开始,更改为 color2 并返回到 color1。 目前我有:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="1px" android:color="#000000" />
<gradient
android:startColor="#FFFFFFFF"
android:centerColor="#FF8800"
android:endColor="#FFFFFFFF"
android:type="linear"
android:angle="270"
/>
<corners android:radius="10dp"/>
</shape>
我的问题是 centerColor 线太细了。我希望它占据所有字母空间。 我找不到任何使渐变更快的方法。 我已经尝试过使用布局列表,但没有成功。
有什么想法吗?
【问题讨论】:
标签: android background textview gradient shape