React Native Input 组件接受任何数值 [英] React Native Input component takes ony numeric values

查看:52
本文介绍了React Native Input 组件接受任何数值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 React-Native 项目中,我有一个来自 Native Base 的 Input 组件,我希望这个组件只取 0-9 的数值并给出这个字段的默认值,我寻找了关于这个问题的其他问题,我没有知道这些答案可能是针对textInput"组件的,还是以某种方式建议对我不起作用?你能帮我吗?

In React-Native project, I have an Input component from Native Base and I want to this component to take only numeric values 0-9 and give this field default value, I looked for other questions about this issue, I do not know maybe those answers are for 'textInput' component or somehow suggestions did not work for me? Can you help me please?

推荐答案

尝试使用

keyboardType="numeric"

来源

这篇关于React Native Input 组件接受任何数值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆