ios - 文本字段键盘设置为数字键盘,但在选择时显示常规键盘

标签 ios xcode ipad xamarin

我在 xcode 设计器中将我的文本字段的键盘设置为“数字键盘”,它在我的 .xib 中的标签之间添加了以下代码

<textInputTraits key="textInputTraits"
autocorrectionType="no" keyboardType="numberPad"/>

我曾期望选择此TextField时,将显示以下键盘输入:

enter image description here

但是,出现以下输入:

enter image description here

如何将我的文本字段设置为使用第一个输入(或类似的)而不是第二个?

最佳答案

如果您使用的是 iPhone,则可以使用 yourTextField.KeyboardType = UIKeyboardTypePhonePad。 iPad 不支持这种类型的键盘。 iPad 将显示 NumberPad。

关于ios - 文本字段键盘设置为数字键盘,但在选择时显示常规键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22348395/

相关文章:

ios - UIGesturerecognizer 不调用 shouldRecognizeSimultaneouslyWithGestureRecognizer

xcode - IBUIColor.m 中的断言失败 - Xamarin.iOS

ios - 从 Table View controller 到 Tab Bar Controller

java - InetAddress.getAllByName() 抛出 UnknownHostException

xcode - Xcode 8 中的警告 : Instance method nearly matches optional requirement

ios - 设置UINavigationBar的高度

ios - 如何在 iPad Air2 iOS9.2 的某些 ViewController 上强制屏幕方向?

ios - 以编程方式为 iPhone 和 iPad 布局 UI 的最佳实践

ios - 隐藏状态栏时,我的导航栏在 iOS 7 中向上移动

ios - Xcode Swift Parse Framework 安装问题(命令 PhaseScriptExecution 失败)