UITextField Keyboard Not Displaying

I have a very simple screen with a UITextField with a default setting, nothing special.

When I touch UITextField, the keyboard does not appear.

I have no user control, behavior, or anything else, just that, but it doesn't work.

I did this in previous iPhone / iPad apps already on the AppStore, but I can’t understand what is going on here.

A UITextField is created in Interface Builder in the nib file.
I did some research and I added IBAction to the UIViewController for the UItextField TouchDown event and IBOutlet for the UITexField.
In the first line of code, I added:

[textFild becomeFirstResponder]; 

This is the default behavior of UITextField, when you touch it, it becomes the first responder asking the system to display the keyboard.
I debugged it and it ran this line, but the keyboard is still not showing.
Thanks in advance.

+6
iphone uikit uitextfield keyboard
source share
3 answers

I already understood myself! I had a UITextField in a UIViewController that displays from another view controller that responds to motion events, and that the previous view controller was always the first responder. All I had to do was each time I leave the controller view in viewWillDisappear: (BOOL) animated, I call [self resignFirstResponder]; and it's all.

+1
source share

One thing you should check is to make sure that the content view ( UIView containing all the controls), which is the View icon in the Interface application, has User Interaction Enabled . If the parent container does not check this box, even if individual controls are running, you will see this behavior.

+6
source share

Many times your code is right, it's just the settings of your Xcode or Simulator.

Try switching keyboard software in simulator

Simulator --> Hardware --> Keyboard --> Toggle Software Keyboard

OR just hit Command + K , it will do the same

+2
source share

All Articles