有没有办法将 TextView 的所有字母设置为大写? [英] Is there a way to style a TextView to uppercase all of its letters?
问题描述
我希望能够为 TextView
分配一个 xml 属性或样式,这将使它具有所有大写字母的任何文本.
I would like to be able to assign a xml attribute or style to a TextView
that will make whatever text it has in ALL CAPITAL LETTERS.
属性 android:inputType="textCapCharacters"
和 android:capitalize="characters"
什么都不做,看起来它们是用于用户输入的文本,而不是 TextView
.
The attributes android:inputType="textCapCharacters"
and android:capitalize="characters"
do nothing and look like they are for user inputed text, not a TextView
.
我想这样做,以便将样式与内容分开.我知道我可以通过编程方式做到这一点,但我还是希望在内容和代码之外保持风格.
I would like to do this so I can separate the style from the content. I know I could do this programmically but again I want keep style out of the content and the code.
推荐答案
我虽然这是一个非常合理的要求,但 看来你现在做不到. 真是个彻底的失败.哈哈
I though that was a pretty reasonable request but it looks like you cant do it at this time. What a Total Failure. lol
您现在可以使用textAllCaps强制全部大写.
You can now use textAllCaps to force all caps.
这篇关于有没有办法将 TextView 的所有字母设置为大写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!