从here可以看到,mdButton 会将您的文本设置为大写字母。如果我想变成小写怎么办?
使用 css text-transform 编写自己的类,例如,
.tolowercase {
text-transform: lowercase;
}
.tocapitalize {
text-transform: capitalize;
}
并将其应用到输入/按钮。
如果您希望整个系统的 htis 行为覆盖 css 中的 .md-button 类,
.md-button {
text-transform: capitalize !important;/*For Lower case use lowercase*/
}
从 CSS 中的
md-button
中删除文本转换:
.md-button {
text-transform: none
}
在 XML 中:
android:textAllCaps="false"
以编程方式:
mbutton.setAllCaps(false);
整洁。您还可以将引导类
text-lowercase
添加到按钮以覆盖默认值。要在按钮中使用大写(每个单词都以大写字母开头),请确保以小写形式编写按钮名称,然后将引导类 text-capitalize
添加到按钮。这样更容易。
通过app.css
文件中的mud-button-label css类设置
all应用程序按钮:
.mud-button-label {
text-transform: none !important;
}