Can any one please let me know how to disable the 'Go' button on keyboard?
The purpose is: when the text field is empty Go button has to be disable (gray color) and when type some thing the Go button become active and color blue. (Same as Apple Find iPhone app).
Many thanks
In Interface builder, tick the box which is labelled Auto-enable Return Key.
In code do: [textField setEnablesReturnKeyAutomatically:YES];
The Return key (Go key) will only be enabled when the text field is not empty.
Related
After making usernameTextfield firstresponder, I see below screen for entering username.
I want to disble (or not focused) Next button until textfield has 0 characters. How can I do it?
Also, how can I capture tv remotes Back and Press event on keyboard?
I read other post How to disable/enable the return key in a UITextField? but It didn't helped me.
In apple docs, it's mentioned that
optional public var enablesReturnKeyAutomatically: Bool { get set } // default is NO (when YES, will automatically disable return key when text widget has zero-length contents, and will automatically enable when text widget has non-zero-length contents)
If this is not possible, then is it possible to add tapgesturerecognizer on this screen so that I can know when user click or pressed Menu button on Remote?
As of now my research says its not possible to disable return key ( Next / Done ) in tvOS but its possible to know when user clicked Next or Done button on keyboard by using .primaryActionTriggered event.
I can't find any other question on how to prevent this, and nothing I've tried is working perfectly.
I want to make it so the title color of the text on my button is ALWAYS white (I will do some other styling to make this look good still).
But, every time I press on the button, the title color changes from white to grey. How can I stop this? Preferably in the storyboard file instead of programmatically.
Images for illustration:
Not pressed:
Pressed:
Select -> Type: Custom in Attributes ispector
Question is, Whether a button can be placed below the software keyboard that comes in the iPhone when we tap to enter some text.
The soft keyboard comes from the very bottom of the screen , can it be made to move little up and a button can be placed ??
No, this is impossible with public APIs. Your only other option would be to use a completely custom input view.
Hi I Have 3 tabs in one sceen..
first tab:some edittext fields with some data in disable mode.initially only one button will be there ie "edit",when u click "edit" then fields will change to editable mode.and "save","cancel" buttons will come.
My Requirment:if we change data in edittext fields and if u are trying to change tab I should display an alert box saying that "do u want to save data?"
can any one tell how can i achive this?
thanks in advance
Just implement OnTabChangeListner in main activity and in this check whether edit text is in editable mode.u can check it by using a flag. set flag when user press on edit button. if flag is true then show alert.
Is there some way to have a keyboard of type UIKeyboardTypeNamePhonePad start in phone number pad mode rather than alphabetic? The keyboard works well for what I need but I'd like it to start in the "other" mode since that is more likely what the user will enter.
I believe that by setting the keyboardType property to UIKeyboardTypeNumbersAndPunctuation, you will default to the numbers and punctuation view, while still having the option of returning to the "ABC" view. Apple's documentation on it: http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextInputTraits_Protocol/Reference/UITextInputTraits.html
Related question: how to show numbers in the default keyboard initially for UITextField
Unfortunately the answer to this question is NO, but there is a workaround.
You can use the UIKeyboardTypeNumberPad and add a custom button (e.g. https://stackoverflow.com/a/4826342/61569) to switch the keyboard to UIKeyboardTypeNamePhonePad. The challenge with this workaround is to support the keyboard styles of different versions of iOS with this custom button
The UIKeyboardTypeNumberPad does not have the 'Done' or the 'ABC' button that will allow you to toggle back and forth between default keyboard and the NumberPad. Now you can choose to go with what #Anthony F suggested but remember you risk the chance of loosing the custom 'Done' button everytime Apple releases newer versions of iOS and move their keyboard window around. To achieve what you want, your best bet will be to set your keyboardType to UIKeyboardTypeNumbersAndPunctuation. This way, you have your keyboard NumberPad loaded up automatically when your view load and have the 'ABC' button also present to be able to toggle between the default keyboard also if you want.
self.myTextfield.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
In the textfield in question, You set the kind of keyboard you would like it to "activate":
[self.myTextfield setKeyboardType:UIKeyboardTypeNumberPad];