带小数的数字键盘 [英] Numeric keyboard with decimal

查看:93
本文介绍了带小数的数字键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用方程式构建应用程序,我使用了数字键盘,但我想在上面放一个小数位.默认值为仅数字.如何在该键盘上添加小数输入?

I´m building an app with equations and I have used a numeric keyboard but I want to have a decimal slot on it. The default is only numbers. How do you add a decimal input on that keyboard?

这是我用来获取数字键盘的代码

This is the code I use to get the numeric keyboard

.keyboardType = UIKeyboardType.NumberPad

推荐答案

只需更改键盘类型:

self.someTextField.keyboardType = UIKeyboardType.decimalPad

请参见文档用于所有键盘类型.

See the documentation for all the keyboard types.

这篇关于带小数的数字键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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