【问题标题】:In TextView, how do I change only part of the Text Style?在 TextView 中,如何仅更改部分文本样式?
【发布时间】:2015-02-06 07:17:30
【问题描述】:

抱歉,问题的标题是在谷歌翻译中创建的。 我的英文太短了..

无论如何,我的问题是如何在一个 TextView 中更改部分文本样式..

例子,

TextView1 的文字:

Hi, I am a Human. // Default TextSize 10
Hi, I am a Elf. // Change TextColor Blue
Hi, I am a Oak.  // Change TextColor Green, TextSize 15
Hi, I am a Dragon. // Change TextColor Red, TextSize 18

这可能吗?

【问题讨论】:

标签: android


【解决方案1】:

你可以使用spannable string,或者一些带有rich textview widget的库,比如https://github.com/quiqueqs/BabushkaText

【讨论】:

  • 为此投票! BabushkaText 是一个很棒的库,如果你必须在 TextViews 中做很多样式,它真的会让你的生活更轻松。
  • 谢谢,我试试这个!
【解决方案2】:

我用书法也有同样的问题

https://github.com/chrisjenx/Calligraphy

一切正常……

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-28
    • 2011-01-19
    • 1970-01-01
    相关资源
    最近更新 更多