开发者

Android virtual keyboard turn on caps lock

开发者 https://www.devze.com 2022-12-30 06:52 出处:网络
I have an edit text field. When the user clicks on it by default it shows small letters on the v开发者_运维知识库irtual keyboard.

I have an edit text field. When the user clicks on it by default it shows small letters on the v开发者_运维知识库irtual keyboard.

I want by default to display first letter caps and rest of them small on the keyboard.

How can this be done?


android:capitalize is deprecated. So please use: android:inputType

android:inputType="textCapSentences"


Try adding android:capitalize="sentences" to the definition of the EditText in your Layout file. This should capitalize the first character of the sentence. If you want to begin each word with a capital letter use words.

More about this can be found in the API.


In order to captialize every character of EditText use these property.

android:capitalize="characters"


I used below attribute with textCapCharacters value in my EditText to turn on caps lock on the virtual keypad and it worked.

android:inputType="textCapCharacters"


To capitalize all characters of Keyboard use this in your edittext in xml:

android:inputType="textCapCharacters"

To capitalize of the first character of every sentence use this :

android:inputType="textCapSentences"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号