简体   繁体   English

React Native TextInput多行数字keyboardType?

[英]React Native TextInput multiline numeric keyboardType?

I really need my TextInput to be numeric, so I have 我真的需要我的TextInput是数字,所以我有

<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. 如果我使keyboardType不是数字,那么我可以使多行工作。

Is there a way to have both? 有两种方法可以同时拥有吗?

I'm on Andoird, don't know if that makes a difference 我在和Andoird,不知道这是否有所作为

I know that this is not optimal, but you can try to use this library here: 我知道这不是最佳的,但你可以尝试在这里使用这个库:

react-native-autogrow-textinput 反应天然-自动增长-的TextInput

Idk, if it will solve your problem, but it's a good test if you haven't tried it yet. Idk,如果它可以解决你的问题,但如果你还没有尝试过,这是一个很好的测试。

I hope it helps! 我希望它有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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