numberOfLines TextInput property not working
我已经在
这是我的代码:
1 2 3 4 5 6 7 8 9 10 | <TextInput ref='textInput' multiline={true} numberOfLines: {5} onChangeText={this.onChangeText} style={[styles.textInput, {height: context.props.textInputHeight}]} placeholder={context.props.placeholder} placeholderTextColor="#5A5A5A" value={context.state.text}/> |
我也在
1 2 3 4 5 6 7 8 9 | getDefaultProps() { return { placeholder: 'Type a message...', navHeight: 70, textInputHeight: 44, numberOfLines:5, maxHeight: Screen.height, }; }, |
但是没有用。
要恢复:
1 2 3 4 5 | <TextInput ... numberOfLines={Platform.OS === 'ios' ? null : numberOfLines} minHeight={(Platform.OS === 'ios' && numberOfLines) ? (20 * numberOfLines) : null} /> |
您可以使用
您有
此外,还建议设置样式
您应该设置