gpt4 book ai didi

android - 如何在 android 布局本身中跨越 textview?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:05:42 25 4
gpt4 key购买 nike

我可以跨 TextView 使布局本身的某些部分加粗吗?我有大约 20 个 xml 文件。我没有为他们使用任何 Activity ,所以我不能以编程方式进行。那么有没有办法在 xml 布局本身中指定它。我已经尝试在它们之间使用,但它不起作用。

android:text="Lets look how to make <b> negative sentences <b> in simple present tense."

不起作用。

最佳答案

您可以在 xml 中设置 textView 的样式,但我相信它必须是字符串资源而不是像您正在做的那样硬编码值。将字符串移动到 strings.xml 并使用资源 ID 访问它

 android:text="@string/name"

检查这个post .

引用自帖子:

Supported HTML elements include:

<b> for bold text.
<i> for italic text.
<u> for underline text.

关于android - 如何在 android 布局本身中跨越 textview?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12258473/

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