简体   繁体   English

在TextView中,如何仅更改文本样式的一部分?

[英]In TextView, how do I change only part of the Text Style?

sorry, question's title was created in google translate. 抱歉,问题的标题是在谷歌翻译中创建的。 My english is too short.. 我的英文太短了..

anyway, my question is How to change part of text style, in One TextView.. 无论如何,我的问题是如何在One TextView中更改部分文本样式..

Example, 例,

TextView1's text: 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

is that possible? 那可能吗?

您可以使用spannable字符串,或具有丰富textview小部件的某些库,例如https://github.com/quiqueqs/BabushkaText

I have same problem i use calligraphy 我有同样的问题,我用书法

https://github.com/chrisjenx/Calligraphy https://github.com/chrisjenx/Calligraphy

It working fine.... 它工作正常....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM