我有以下 TextView:
<TextView android:id="@+id/theFooBar"
android:autoLink="web"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/fooBar"
android:textColor="@android:color/black"
android:textSize="20sp"/>
和字符串:
<string name="fooBar">Foo <u>bar</u>.</string>
这给出了我的黑色下划线文本。如果我想要链接的蓝色、无下划线文本(“bar”部分),但我希望其余部分(“foo”部分)为黑色怎么办?我怎样才能做到这一点?
最佳答案
在TextView中添加android:textColorLink来定义链接的文本颜色
关于android - 如何设置 autoLink ="web"链接的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5998618/