不能在android studio中小写按钮文本 [英] Cannot lower case button text in android studio
问题描述
我有一个小问题困扰了我一段时间.我试图用谷歌搜索这个,但似乎没有人和我有同样的问题,或者不认为这是一个问题.当我在布局
I have a trivial question that has been bothering me for a while. I tried to google this but no one seems to have the same problem as me or doesn't see it as an issue. When I make a button in activity_my.xml under layout
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_1_name"
android:id="@+id/button2"
android:layout_marginTop="140dp"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true" />
我得到一个看起来像的按钮
I get a button that looks like
即使我的字符串代码是:
even though my strings code is:
<resources>
<string name="app_name">HelloWorld</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="button_1_name">BuTtOn 1</string>
我知道我在这里肯定遗漏了一些小东西,但是如何在按钮文本中使用小写/大写?
I know I am definitely missing something small here, but how do I get lower case/upper case working in the button text?
谢谢!
推荐答案
您可以将 android:textAllCaps="false"
添加到按钮.
You could add android:textAllCaps="false"
to the button.
按钮文本可能会被应用到所有按钮的应用主题转换为大写.检查主题/样式文件以设置属性 android:textAllCaps
.
The button text might be transformed to uppercase by your app's theme that applies to all buttons. Check themes / styles files for setting the attribute android:textAllCaps
.
这篇关于不能在android studio中小写按钮文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!