Issue
I want to create a TextInput which can grow automatically when it has multilines.
<TextInput
placeholder="Type Comment"
value={this.state.comment.value}
onChangeText={value => this.onChangeComment(value)}
onPress={() => this.uploadComment()}
multiline={true}
maxLength={200}
numberOfLines={5}
/>
How can I achieve this?
Solution
Think that the React Native team fixed it in current version (0.59) with the multiline
prop.
This works for me
<TextInput
style={{
width: '90%',
borderColor: 'gray',
borderWidth: 1,
padding: 2,
}}
multiline
onChangeText={text => this.setState({ text })}
value={this.state.text}
/>
Answered By - Norfeldt
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.