views:

180

answers:

1

Hi all,

Sorry if my question if a dumb one, but I couldn't find a way to solve it. The thing is a have a custom text view that sometimes need to wrap text according to its own rules. Everything works just fine with static content, but if I insert a @"\n" as the user starts to write another word (I know the word he's going to type and I know it won't fit anyway), iPhone keyboard automatically toggles shift on, which drives the user mad as he didn't intend to capitalize the word. It's mission critical for me to have those wraps working, so I either need a way to end line in another way or toggle shift on keyboard back.

Or, in two words: how can I toggle keyboard's shift off programmatically?

Anybody?

UPDATE Guys, a small question around the keyboard on iPhone. AFAIK we can get keyboard's object (by fetching UIKeyboardImpl class and calling +sharedInstance on it) and obviously do some things around it. However, I also heard that Apple is very concerned around such hack, so I'm curious if they could reject the app if I fix the issue using such approach? Obviously, I'm not going to change kayboard outlook, and even logic remains the same (at least from human's point of view), but is this enough to not get ass-kicked?

UPDATE 2 For now I managed to achieve the desired behavior by turning autocap off and setting shift state manually. Is there a better solution?

+3  A: 

There is no way to toggle the shift manually on the keyboard (at least not without using some undiscovered private API), but you can control the Autocapitalization behavior of the textfield by saying [myTextField setAutocapitalizationType:UITextAutocapitalizationTypeNone];

Dave DeLong
You solution won't work for me, as I still want the user to utilize all iPhone's tricks re text input (autocaps, autocorrection etc) – just to make all feel smooth. I just want to fix it's behavior in case when it fails.
Anton