gpt4 book ai didi

android - 如何设置 autoLink ="web"链接的样式?

转载 作者:太空宇宙 更新时间:2023-11-03 13:36:52 26 4
gpt4 key购买 nike

我有以下 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com