Custom iPhone return key text - iphone

Is it possible to set custom return key type for UITextField?
[txtField setReturnKeyType:UIReturnKeyDefault];
I want to have the word "SHARE" in place of the return key type.
Thanks

Nope. You get the return key and keyboard types defined in the OS. Unless you want to try to hack the keyboard's view hierarchy to change that button, which would be a really bad plan. (Standard recommendation here is to file a bug report with Apple to let them know you'd like more/different options.)

Related

UITextField keyboard return button title

I wanted to change the name of the return button key as I'm not developing the app in English. I'm having an UIAlertController and added a textField (.addTextFieldWithConfigurationHandler { (textField) -> Void in <someCode> }). How can I now change the title of the return button key in Swift? Actually there shouldn't be any difference to a normal UITextField. Thank for any help :]
You cannot set custom text for the return key on iOS. There are a number of options but those are the only ones.
If you are only worried about translation, the keys will be translated automatically depending on the language that is configured on the users device. Otherwise, you are going to have to create an entirely custom keyboard (which is almost certainly not worth the effort).

How to customise the default keyboard in Xcode 5

when we click the text field, the default keyboard or keypad not to be appear instead i need to display the custom keyboard..
Did any one know the answer please post it..
Declared in
UIResponder.h
UIInputViewAudioFeedback protocol.
Is this method correct or else there having any simple method to work out?
You need to create a protocol for this for having a custom keypad appearing throughout the app. I have made it few months back and the stuff was working well. My requirement was to create a keyboard for farsi language, because ios does not have farsi in its language settings.
There is no need to make protocol if you want it in just 1 viewcontroller.
Here is my that thread:
customized keypad on the iPhone Application
Here's something that I created that might help. Just fork it on GitHub and change the Punjabi characters to Myanmar. Most of the hard work is done for you :)
https://github.com/kulpreetchilana/Custom-iOS-Keyboards
Per your comment you need the Number Pad keyboard.
Set your UITextField keyboardType property, either via Interface Builder or programmatically:
textfield.keyboardType = UIKeyboardTypeNumberPad;

Iphone SDK, switch keyboard in app

I have one question, may be it is very simple, but I do not know about this nothing...
For example, I have an application, application with textfield, I want to know two things.
First: Is possible to switch keyboard when application in runtime?
Second: how I can switch type of keyboard(Russian, English, Swedish, etc.) in my application*?
*-without going to Settings->General->Keyboard->add new keyboard.
Not sure about changing languages (I did find this other post about it: change input source language programmatically OSx), but changing the keyboard is pretty easy. Here is a one line example:
textField.keyboardType = UIKeyboardTypeURL;
Take a look at the UITextInputTraits protocol reference for more info. Then the question comes in where to implement this. I am assuming that you want to check conditions right before the keyboard comes up, you may have to implement UITextFieldDelegate protocol (and maybe using the field's tag to see which field the cursor is in).
Hope this helps.

iOS keyboard with "Go" button instead of return

Is there a way to use the keyboard with "Go" key instead of the "Return" key like when you are accessing login fields in Safari? I'm guessing this should be something trivial but my searches aren't turning up anything. :(
Thanks in advance.
For a UITextField or editable UITextView:
[myTextField setReturnKeyType:UIReturnKeyGo];
You can also configure this in Interface Builder, under Text Input Traits for your text field/view:
In Xamarin.iOS or Monotouch is:
myTextField.ReturnKeyType = UIReturnKeyType.Go;
Possible values are:
Default
Go
Google
Join
Next
Route
Search
Send
Yahoo
Done
EmergencyCall
Continue
myTextField.returnKeyType = UIReturnKeyType.Go
Other options for return key name can be found at: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextInputTraits_Protocol/#//apple_ref/c/tdef/UIReturnKeyType
You can use this simple way: [textField setReturnKeyType:UIReturnKeyGo]; instead of "Add" button.
Other, you create a programmatically keyboard with buttons which you want.

suppress keyboard in iphone UiWebViews

I have an app that uses UiWebViews, and I need to not show the keyboard for a text field within such a view. I provide my own buttons that insert the limited sorts of text the field allows, but I also need to allow pasting (I will filter what gets pasted) and adjusting the cursor position. Any way to do this?
It looks like this can't be done, I've researched it further and that's pretty clear. I don't want to accept a wrong answer, so I figured I'd just answer this myself and say: can't be done.
if you just want the textField do normal things except the showing keyboard action, you could subclass UITextField and overwrite the touchesBegan/Moved/Ended, just call super touchesBegan/Moved/Ended and add additional code which would hide the keyboard, if you have a reference to the keyboard ( you may figure it out urself how-to ), call the method : [keyboard resignFirstResponder], you may try to Category the UITextField class so you would have the reference to the keyboard ( if it's private ) - but not recommended because categorying may break our project design, but if you just need it for the only purpose, give it a try. Hope it helps.