UITextField keyboard: enable done button when no text is entered - ios

I have a UITextField in my app. When the user selects it, a keyboard is presented with a done button. The keyboard is dismissed by pressing the done button. But the done button is only enabled after the user has entered text. I want the user to have the option of dismissing the keyboard without entering text. Is it possible to enable the done button before text has been entered?

OK, I discovered this is resolved by unchecking the Auto-enable Return Key property in the Attributes Inspector.

Related

How to hide keyboard without closing the dialog box using Appium for IOS?

I have a dialog box that appears and while closing keyboard with hideKeyboard(); all the form is closed and i get back to the home page so that i can't continue the scenario for filling other data.
Here the screen :
Just use UIScrollView in your dialog box, and set scroll view class TPKAScrollViewController. Download class
You can fill up the fields first using driver.sendkey() then tap on keyboard next button to switch the driver to the next field untill the last field. in last field you will get done button then you can tap on that button.
The default "strategy" of hideKeyboard(); is to tap outside the keyboard, but this can be changed to pressing a key on the keyboard instead.
See the java-client documentation (assuming you're using java-client?) for available hideKeyboard strategies: http://appium.github.io/java-client/io/appium/java_client/ios/IOSDeviceActionShortcuts.html
If your app's keyboard has for example a "Next" button to close the keyboard with, then you could use: driver.hideKeyboard("Next");

iOS -Objective C- Prevent the keyboard automatically hide when I set enable = NO on UITextField

I'm working on an App with Objective-C but I have a problem with my form.
I have several inputs view (UITextField) on it, and one with a particularly behavior.
When I select the checkbox, I prevent the user typing on the view and looks the view as disable( grayed out and without the blue bar flashing blue bar ) and keep the keyboard open.
When I set the UITextField as disable, the keyboard is automatically hidden.
Someone knows how to keep the keyboard open?
I need to something like the image attached, but without the blue bar flashing blue bar.
I did the logic to prevent the the user enter data on the input , but the keyboard is automatically hidden.
If the text field is disabled, the user cannot type into it and the dismissal of the keyboard is correct. You should not try to fight against that. (It sounds like you're trying to disable the keyboard for the wrong reasons anyway.)
In this case, it sounds like your timing is just off. When the user clicks the checkbox, your code responds. What you are doing there is just wrong. You should respond by moving the first responder to the next enabled text field yourself, and then disabling the first text field. That way, you are not disabling the text field while it is first responder; that's your whole mistake right there.

iOS How to detect focus change between textfields in custom keyboard?

I am making a custom keyboard and i want to change my keyboard layout to adapt to the UITextField type (url, websearch, email) every time user change the focus between textfields.
For example:
Beginning, user inputs in url textfield, my keyboard will show a dot button.
After finished the editing in url textfield, user focus on email textfield, my keyboard will replace a dot button by # button.
The question is how to catch this even in custom keyboard?

How do I set a UITextField as the default input field at app launch

I am writing an iPhone app with a keypad and two TextFields on a single view. The user types into each of the text fields. Because I want to use an on-screen keypad, I disabled the the keyboard from launching when each TextField is selected. (I used the method suggested in this thread:
Disable UITextField keyboard?
So far so good EXCEPT the cursor doesn't blink in the either of the two TextFields until they are selected. If I just begin typing without selecting, the first textfield is filled. That's OK, but I would like to set the cursor flashing in that field so the user is notified that that is where the input will go unless they select the other field.
I did not create the text fields programatically. I created them with Interface builder.
How do I programatically select the desired starting text field (ideally some highlight would show up when selected). Right now I just got lucky and the field I want to be the default is the default.
How do I place the flashing cursor onto the right side of that text field.
...Dale
Call [myTextField becomeFirstResponder]; this will notify the receiver that it is about to become first responder in its window. That should set the Cursor in the UITextField.
To programmatically activate a field and make it your starting text field you should use UIResponder's becomeFirstResponder method, which all UITextFields inherit from.
[textField becomeFirstResponder];

How do i resign the keyboard from a text field in my app settings

IOS xcode, in my root.plist i have 3 text fields. The user is able to change the strings for these fields which then saves in the nsUserDefault. While in the app settings page if the user click on the field to edit it the keyboard pops up. when they hit return focus moves to the next text field. Moving the focus off the text fields does not resignFirstResponder.
Since this is the Apple Settings page I don't have a way to assign view controller to create my method to resign the keyboard.
How do I resignFirstResponder from the app setting page.
you won't be able to do that...settings is a native *iOS* app..apple does not provide return in the text fields there..user has to navigate back...to hide the keyboard

Resources