有没有一种方法可以将TextView的样式设置为全部大写呢? [英] Is there a way to style a TextView to uppercase all of its letters?

查看:342
本文介绍了有没有一种方法可以将TextView的样式设置为全部大写呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够为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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆