【问题标题】:Only show numeric keyboard just like iPhone on iPad is possible?可以像 iPad 上的 iPhone 一样只显示数字键盘吗?
【发布时间】:2019-06-14 09:24:22
【问题描述】:

我已经尝试了keyboardType 的所有类型,它会在iPad 上显示数字和其他字符。

我尝试的keyboardType包括'default', 'email-address', 'numeric', 'phone-pad', 'ascii-capable', 'numbers-and-punctuation', 'url', 'number-pad', 'name-phone-pad', 'decimal-pad', 'twitter', 'web-search'

<TextInput 
  style={styles.textInput}
  keyboardType='numeric'
  onChangeText={(tex) => this.changeText(tex)}
  value={this.state.text}
  placeholder={'0912 345 678'}
  placeholderTextColor='rgba(33, 33, 33, 0.41)'
/>

有什么方法可以实现它只显示数字键盘吗?

提前致谢。

【问题讨论】:

    标签: react-native


    【解决方案1】:

    iPad 似乎不包含纯数字键盘。 为了实现这一目标,您需要创建自己的数字小键盘。

    @bjtitus in this question 推荐了一些很好的例子。

    希望这个Github Link 对您也有帮助。

    【讨论】:

      猜你喜欢
      • 2011-12-28
      • 1970-01-01
      • 1970-01-01
      • 2013-05-02
      • 2011-09-04
      • 1970-01-01
      • 2014-04-29
      • 2015-02-09
      • 1970-01-01
      相关资源
      最近更新 更多