简体   繁体   中英

React Native TextInput multiline numeric keyboardType?

I really need my TextInput to be numeric, so I have

<TextInput keyboardType = 'numeric' />

But I also am expecting a lot of digits, so I wanted to enable multiline input

<TextInput
    multiline = {true}
    keyboardType = 'numeric'
/>

But multiline doesn't appear to have any effect when it's numeric. If I make the keyboardType not numeric, then I can get multiline working.

Is there a way to have both?

I'm on Andoird, don't know if that makes a difference

I know that this is not optimal, but you can try to use this library here:

react-native-autogrow-textinput

Idk, if it will solve your problem, but it's a good test if you haven't tried it yet.

I hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM