How do I set mdButton text to lowercase?

别来无恙 提交于 2019-12-23 07:45:43

问题


As you can see from here, mdButton will set your text with uppercase letters. What if I want to make lowercase?


回答1:


Write your own class using css text-transform such as,

.tolowercase {
    text-transform: lowercase;
}

.tocapitalize {
    text-transform: capitalize;
}

And apply it to the input/button.

If you want htis behaviour throughout the system override the .md-button class in your css,

 .md-button {    
    text-transform: capitalize !important;/*For Lower case use lowercase*/
}



回答2:


in XML:

android:textAllCaps="false"

Programmatically:

 mbutton.setAllCaps(false);



回答3:


Neat. You can also add the bootstrap class text-lowercase to your button to override the defaults. To use capitalization in your button (each word to start with a capital letter), ensure that you write your button name in lowercase, then add the bootstrap class text-capitalize to your button. Easier that way.




回答4:


Remove the text-transform from md-button in CSS:

md-button {
  text-transform: none
}


来源:https://stackoverflow.com/questions/33728424/how-do-i-set-mdbutton-text-to-lowercase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!