开发者

Problem in autocapitalization of text

开发者 https://www.devze.com 2023-02-06 13:39 出处:网络
I had problem in auto capitalization. I want to enter a product name which contains only a-z and 0-9. So I had taken nameField.keyboardType = UIKeyboardTypeNamePhonePad. I want first letter to be capi

I had problem in auto capitalization. I want to enter a product name which contains only a-z and 0-9. So I had taken nameField.keyboardType = UIKeyboardTypeNamePhonePad. I want first letter to be capital letter so I had taken nameField.autocapitalization = YES. when I entered product name for first it is taking capital letter which is working fine. But the problem is occurred: when I entered product name and I had poped to anot开发者_如何学Cher view controller with out saving product name. next time if I want to enter product name it is not taking capital letter.

Please help me

Thank You Praveena Nalajala.


In :

  - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string

Test if you enter first letter and if YES do an [string capitalizedString]

0

精彩评论

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