有没有一种方法可以将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屋!