How to make a text box multi-line in a native reaction?

I have a Name text box. When I write a name, it goes right on one line. I want her to move to the next line after she reaches the width of the text box. When I use multiline = 'true', I got an error:

Error updating property of a "multi-line" view managed by: Android TextInput.

Here is my code:

<TextField 
      label = {'Name :'}
      highlightColor = {'#00BCD4'} 
      style = {{height: 40}}
      multiline = 'true' />
+4
source share
3 answers

Change multiline = 'true'to multiline = {true}, the property value should be a boolean, not a string

<TextField 
      label = {'Name :'}
      highlightColor = {'#00BCD4'} 
      style = {{height: 40}}
      multiline = {true}
    />

Are you sure it is TextField, and not TextInput?

https://facebook.imtqy.com/react-native/docs/textinput.html

+2

TextInput, TextField, , , ...

<TextInput style={...} multiline={true} value={...} />

+1

You cannot have multiple lines with TextField, you must useUITextField

0
source

Source: https://habr.com/ru/post/1651252/


All Articles