First letter in UiTextField lowercase

前端 未结 11 1471
旧时难觅i
旧时难觅i 2020-12-24 04:45

How do you make it so that when you start typing on the keyboard after youve clicked on a UITextfield the first letter isn\'t a capital automatically?

相关标签:
11条回答
  • 2020-12-24 05:28

    You can turn off auto-capitalization with the .autocapitalizationType property in the UITextInputTraits protocol.

    textfield.autocapitalizationType = UITextAutocapitalizationTypeNone;
    
    0 讨论(0)
  • 2020-12-24 05:29

    I think now is: http://docs.appcelerator.com/titanium/2.1/index.html#!/api/Titanium.UI.TextField-property-autocapitalization

    0 讨论(0)
  • 2020-12-24 05:30

    In Swift:

    textField.autocapitalizationType = UITextAutocapitalizationType.None
    
    0 讨论(0)
  • 2020-12-24 05:30

    To avoid completely there are three properties that we can set

    textField.autocapitalizationType = .none;
    

    and

    textfield.autocorrectionType = .no;
    

    and

    textField.spellCheckingType = .no
    

    Only setting .autocapitalizationType = .none; works but better we set other both the properties to avoid capitalising from autocorrection and spell checking.

    0 讨论(0)
  • 2020-12-24 05:31

    Try this code:

    textfieldname.autocapitalizationType = UITextAutocapitalizationTypeNone;
    
    0 讨论(0)
提交回复
热议问题