android - text input type person name isn't working

前端 未结 4 1480
猫巷女王i
猫巷女王i 2021-01-20 15:03

In my android project I want a textfield of type personname where by default caps lock is activated, however, this code isn\'t working.



        
相关标签:
4条回答
  • 2021-01-20 15:39

    If you want all caps, just use android:textAllCaps="true"

    0 讨论(0)
  • 2021-01-20 15:43

    Use

    android:inputType="textPersonName|textCapWords"
    

    as using only "textPersonName" is not enough so name's first letters would be capitalized.

    Similarly with postal addresses:

    android:inputType="textPostalAddress|textCapSentences"
    
    0 讨论(0)
  • 2021-01-20 15:45

    I used this for the caps words and no suggestion

    android:inputType="textCapWords|textNoSuggestions"
    

    e.g. Tom Hanks

    0 讨论(0)
  • 2021-01-20 15:52

    If you try to display person name as normal, try this: android:capitalize="words". If you want to all caps you can change words into characters or doing like Mr. LuxuryMode said!

    Edited:

    You should remove android:inputType="textPersonName" field. It will work!

    0 讨论(0)
提交回复
热议问题