自定义数字键盘 UIKeyboard
我将如何创建一个自定义数字键盘,就像“Tipulator”和其他应用程序中使用的那样。
我知道如何自定义 UIKeyboard,但他们的数字键盘看起来完全不像默认的数字键盘。它是一个 UIKeyboard 还是一个单独的 UIView?
How would I go about creating a custom number pad like what is used in 'Tipulator' and other apps.
I know how you can customize UIKeyboard, but their number pad doesn't look at all like the default number pad. Is it even a UIKeyboard or a separate UIView?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用键盘已经有一段时间了。我想说,这是否容易取决于您的目标文本输入视图是什么。如果是 UITextView 那么我们就可以了,如果是 UITextField 你可能会遇到一些问题,因为你无法像 UITextView 一样访问当前光标文本位置。
(您可以检查 UITextView 和 UITextViewDelegate 方法)
如果您只想设置一个字符串并且不介意当前光标文本位置,那么您不需要键盘。 (我认为 Tipulator 就是这种情况)
顺便说一句:我刚刚在 youtube 上看到 Tipulator,不需要键盘来做到这一点。
I've been working with keyboards for quite a time. I would say that the easiness of this depends on what your target text input view is. If is a UITextView then we are fine, if is UITextField you might have some problems because you don't have access to current cursor text position like un UITextView.
(You might check UITextView and UITextViewDelegate methods)
If you just want to set a string and don't mind current cursor text position, then you don't need a keyboard. (I think this is the case of Tipulator)
BTW: I just saw Tipulator in youtube and there is no necessity of a keyboard for doing that.
从外观来看:它是一个自定义的 UIView 子类。基本上,它只是一个带有 11 个按钮的面板,所以应该很容易做到。
Judging by the looks: It's a custom UIView subclass. Basically, it's just a panel with 11 buttons on it, so it should be rather easy to do.