I have a UIView with a UITextView as a subview. I want the keyboard to appear automatically with the view and call
Code:
[textView becomeFirstResponder]
but this does not work AND for some reason, it then takes 2 presses to get the keyboard to show. If I do not make the first responder call, 1 press will make the keyboard appear.
This same technique works correctly for a UITextField.
I'm having this problem, too. when I add a becomeFirstResponder message before I add the textView to the viewController's view, the view loads with a cursor in the textView, but with no keyboard. No tapping will bring the keyboard up, either. Here's my code:
Also, I've set the keyboard's return key type to Done, but the key still adds a newline rather than telling the textView to resign first responder. If I am supposed to handle this manually, how so?
Anyone figure this out? I have all the same settings as those from the OP. Just want to that darn keyboard to show up with my view is displayed. UITextView is already set as firstresponder and when the view is shown my cursor is sitting in the TextView but no keyboard.
Anyone?
__________________
---------------------------------------------------------------------- I love being a dad, flying airplanes and writing code.
----------------------------------------------------------------------
Follow me on Twitter: @BostonMerlin
Feed your brain on Twitter: @iPhoneDev101
----------------------------------------------------------------------
iPhone Apps:
Anyone figure this out? I have all the same settings as those from the OP. Just want to that darn keyboard to show up with my view is displayed. UITextView is already set as firstresponder and when the view is shown my cursor is sitting in the TextView but no keyboard.
Anyone?
There's no work around, you simply have to wait until Apple fixes it. Hopefully that will be really soon now. You might want to look around at the iPhone developer website...
Found a workaround. I really do not recommend doing this -- as the workaround relies on another bug, and there's no stopgap so that if that bug is fixed, the keyboard will show up by default.
Remove all becomeFirstResponder's for the UITextView, then in your viewDidAppear, set editable to NO, then set editable to YES:
Found a workaround. I really do not recommend doing this -- as the workaround relies on another bug, and there's no stopgap so that if that bug is fixed, the keyboard will show up by default.
Remove all becomeFirstResponder's for the UITextView, then in your viewDidAppear, set editable to NO, then set editable to YES:
... which makes it work for me (in a modal controller).
I found that this code works on the device but not in the simulator (2.1)... which for me is just fine for now. thanks!
John
__________________
---------------------------------------------------------------------- I love being a dad, flying airplanes and writing code.
----------------------------------------------------------------------
Follow me on Twitter: @BostonMerlin
Feed your brain on Twitter: @iPhoneDev101
----------------------------------------------------------------------
iPhone Apps: