【发布时间】:2012-11-13 16:04:09
【问题描述】:
就像一支黄色荧光笔。如何在两端圆角的 TextView 文本上画一条细黄线?
谢谢
【问题讨论】:
-
您是在询问突出单个单词或短语吗? (三个人已经建议了添加边框的相同链接......)
标签: android textview highlight thin
就像一支黄色荧光笔。如何在两端圆角的 TextView 文本上画一条细黄线?
谢谢
【问题讨论】:
标签: android textview highlight thin
您可以使用渐变并根据需要控制它:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#FFFF00" android:centerColor="#FFFF00"
android:endColor="#FFFF00" android:angle="0" />
<corners android:radius="30dp" />
</shape>
并在 xml 中将 textview 引用到该渐变,如下所示:
android:background="@drawable/gredient"
希望能帮到你。
【讨论】: