I'm having a multiline text in my react native view. When user types , in keyboard view I need to show done (tick mark) button. Instead of that it shows next line icon. Is there any way to achieve this. If I use text input I can do that , but I need multiple lines to be added. This is my text input
<TextInput style = {styles.contactInput}
underlineColorAndroid="transparent"
multiline = {true}
placeholder="Type your feedback here"/>
I'm having a multiline text in my react native view. When user types , in keyboard view I need to show done (tick mark) button. Instead of that it shows next line icon. Is there any way to achieve this. If I use text input I can do that , but I need multiple lines to be added. This is my text input
<TextInput style = {styles.contactInput}
underlineColorAndroid="transparent"
multiline = {true}
placeholder="Type your feedback here"/>
Share
Improve this question
edited Feb 21, 2018 at 7:13
Tomasz Mularczyk
36.3k19 gold badges118 silver badges174 bronze badges
asked Feb 20, 2018 at 18:01
venuravenura
1253 silver badges15 bronze badges
3
- The done button on the keyboard? Sorry, not entirely sure what you're looking for. – MattyK14 Commented Feb 20, 2018 at 19:09
- 2 Are you looking to change the 'return key'? If so, there is a prop for it – MC10 Commented Feb 20, 2018 at 19:12
- 1 @MC10 thanks. Your ment's link was broken but the URL pointed me in the right direction, so I made an answer out of it. – ahron Commented Jan 24, 2022 at 5:35
3 Answers
Reset to default 1You can add blurOnSubmit={true} in order to show the submit button rather than the return key
<TextInput style = {styles.contactInput}
underlineColorAndroid="transparent"
multiline = {true}
blurOnSubmit={true}
placeholder="Type your feedback here"/>
The ment by @MC10 points in the right direction, but the link in his ment doesn't work anymore.
The React Native TextInput has a few different return key types. I quote below from the official docs page
Determines how the return key should look.
Cross platform
The following values work across platforms:
done go next search send
So, depending on what you want your return key to look like and do, you should be able to choose one of the above values. There are other OS specific values as well which you can read in the docs.
multiline input is meant to be multiline, meaning that you need enter key to create a new line, for that reason, you cannot change enter key to anything else
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745340581a4623308.html
评论列表(0条)