Resolution for default capitalization of strings in text in controls such as buttons in Android studio

Source: Internet
Author: User

When you're learning Android, adding a button, EditText, and other controls to the XML in Android Studio will always display uppercase text, even if the string you typed is lowercase, and the property that controls string capitalization is Android: Textallcaps,

Finally looked at the Themes.xml file, found some clues, found in the setting style, the default is to put all the string display uppercase true.

is from Android Style.xml,

" Solution "

1. Add a row to the XML in the control you don't want to capitalize

Android:textallcaps= "false"

2. The above method, just for a single control, if you want to be simple, all the controls are not automatically capitalized, you can open the Res folder, locate the Styles.xml file, and then add a line <item name= "Android:textallcaps" >false</item> just fine;

    <!--application theme. -    <stylename= "Apptheme"Parent= "Appbasetheme">        <!--All customizations, that is, specific to a particular api-level can go. -        <Itemname= "Android:textallcaps">False</Item>    </style>

Resolution for default capitalization of strings in text in controls such as buttons in Android studio

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.