【发布时间】:2019-07-10 02:47:42
【问题描述】:
问题:
我的文本输入占位符最多可以包含 2000 个字符。只要我的用户开始输入文本输入,占位符就会消失,但文本输入高度不会自动缩小。
AFAIK,我的多行文本输入的高度是根据占位符文本的原始长度设置的。有没有办法解决这个问题?
我的代码:
import { Input } from 'react-native-elements';
interface Props {
placeHolder: string;
onChangeText: (text: string) => void;
}
const MyTextInput = (inputs: Props) => (
<View>
<Input
inputStyle={{ textAlignVertical: 'top' }}
placeholder={inputs.placeHolder}
onChangeText={(text) => inputs.onChangeText(text)}
multiline={true}
maxLength={2000}
/>
</View>
);
export default MyTextInput;
截图:
【问题讨论】:
标签: javascript android typescript react-native textinput