Change text of Return keyboard button
Unfortunately, you can change "Return" into only one of these predefined labels with the returnKeyType
property:
- Return (default)
- Go
- Join
- Next
- Route
- Search
- Send
- Yahoo
- Done
- Emergency Call
- Continue (as of iOS 9)
So maybe you should choose "Next" if a data entry kind of activity is what you're after.
More information here.
how to change 'return' button in keyboard?
Update for 2019 - RN 0.57 changed the key from "Go" to "go"
you should use returnKeyType property to determine how the return key should look
Example:
<TextInput style={{height:40}}
placeholder="Input"
placeholderTextColor="#DCDCDC"
returnKeyType="go"
/>
Change 'Return' button function to 'Done' in swift in UITextView
You can set the return key type of the text field:
textField.returnKeyType = UIReturnKeyType.done
Update
You can definitely use the same approach to set the return key to "Done", as mentioned above. However, UITextView doesn't provide a callback when user hits the return key. As a workaround, you can try to handle the textView(textView: UITextView, shouldChangeTextInRange range: NSRange, replacementText text: String) delegate call, and dismiss the keyboard when you detect the input of a new line character:
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
if (text == "\n") {
textView.resignFirstResponder()
}
return true
}
Dynamically change keyboard's return button but preserve type
As Martin noted above, it's not a bug on Apple's side, but on my side. However I'll be posting the solution I've found since it is the one that solves that particular problem:
Instead of manually changing the return key type when there is text on the text field, Apple provides us with a property called enablesReturnKeyAutomatically
that when set to YES
it automatically manages the issue, enabling and disabling the return key depending on whether there is text or not in the text field.
Therefore you don't need to modify the returnKeyType
property, and thus, no calling to reloadInputViews
is required, so the keyboard doesn't change back to its original state.
How do I change Text Input Action Button (return/enter key) on Keyboard in Flutter?
The input action for a TextField
(or TextFormField
) can be specified like this (here, the Go button):
TextField(
textInputAction: TextInputAction.go
...
)
List of all available input actions.
React Native Keyboard returnkey change
In order to change the value of the return button, have a look at the docs on TextInput
s returnKeyLabel
(Android Only) or returnKeyType
.
To capture the return event, add the onSubmitEditing
prop to the TextInput
.
Related Topics
How to Create a Colored 1X1 Uiimage on the iPhone Dynamically
Uigesturerecognizer on Uiimageview
Uibutton Image for Normal State in Collectionview Cell Repeats Itself Every Four Cells
Resizing a Uilabel to Accommodate Insets
In Swift How to Call Method with Parameters on Gcd Main Thread
iOS 7.0 No Code Signing Identities Found
Create a Rectangle with Just Two Rounded Corners in Swift
How to Add a 'Done' Button to Numpad Keyboard in iOS
How to I Import 3Rd Party Frameworks into Xcode Playground
Dismissmodalviewcontrolleranimated Deprecated
View with Continuous Scroll; Both Horizontal and Vertical
Draw Dotted (Not Dashed!) Line, with Ibdesignable in 2017
How to Give an "Identifier" to a View Controller Within My Storyboard
Uisearchbar Presented by Uisearchcontroller in Table Header View Animates Too Far When Active