iPhone SDK: disable auto creation of dot (.) in text field (or textview)

后端 未结 2 782
一整个雨季
一整个雨季 2020-12-19 12:28

I\'ve disabled auto-correction type for my text field, and it does not show any other auto-correction,

but it still automatically creates a dot (.) when I press spac

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-19 13:35

    Perhaps if you hook up a text field delegate and then implement the following method:

    -(BOOL)shouldReplaceCharactersInRange:(NSRange)aRage withString:(NSString *)aString
    

    You may be able to check aString for the autocorrected string (maybe @". ") and then just return NO. This will hopefully not allow the @" " to be replaced with @". "

提交回复
热议问题