开发者

UITextView autocapitalization not working for first word of input?

开发者 https://www.devze.com 2023-01-31 12:36 出处:网络
I\'ve created a UITextView and set the autocapitalization property to UITextAutocapitalizationTypeSentences or to UITextAutocapitalizationTypeWords. Both settings work as expected except for the first

I've created a UITextView and set the autocapitalization property to UITextAutocapitalizationTypeSentences or to UITextAutocapitalizationTypeWords. Both settings work as expected except for the first word that is typed, which is not autocapital开发者_StackOverflowized! It is autocapitalized if the user deletes the text taking the cursor back to the start of the line.

My workaround would be to convert the first letter from uppercase to lowercase in the UITextView delegate method textView:shouldChangeTextInRange:replacementText:.

The only tiny issue that remains is that the user is unable to tap on the shift key to prevent the first word from capitalizing.

Do other people experience this issue and is this what you've done?

Thanks.


I think this may be an issue with the simulator. It seems to be working fine on the device!

0

精彩评论

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