Xcode:仅为我自己的应用程序创建自定义键盘 [英] Xcode: Creating a custom keyboard just for my own app
问题描述
我正在开发数学应用程序.所以我需要一个特定的键盘. 我只是可以使用小数点,但是缺少正/负("+/-")按钮.
I am developing a math application. So I need a specific keyboard. I just could take the decimal pad, but there is missing the positive/negative ("+/-") button.
现在,我想对自定义键盘进行编程,或者我想编辑小数点.有什么更容易的?
Now I want to program a custom keyboard or I would like to edit the decimal pad. What is more easy?
如果我要编写自己的自定义键盘,是否可以使用自定义键盘扩展名,还是必须在单独的视图中为每个数字创建一个带有按钮的视图?
If I would program my own custom keyboard, can I use the custom keyboard extension or do I have to create a view with a button for every number in a separate view?
因为我需要在许多不同的视图上使用键盘:是否可以用键盘创建视图并在其他视图之上的容器视图中显示键盘视图?
Because I need the keyboard on many different views: Is there a possibility to create a view with the keyboard and to display the keyboard-view in a container view on top of the other views?
希望你得到我的帮助.
Hope you get my struggle.
推荐答案
是的,您可以创建自己的键盘类(继承自UIView
),而.xib + Auto Layout
可以帮助您使其更加灵活.假设您在UITextField
中使用它,那么您可以在Text Field
中设置inputView
,这样您的自定义键盘将比基本的键盘要多.
Yes, you could just create your own keyboard class (inherits UIView
) and .xib + Auto Layout
will help you to make it more flexible. Lets say you using it inside UITextField
, then you could set inputView
of this Text Field
, so there will be your custom keyboard than basic one.
这篇关于Xcode:仅为我自己的应用程序创建自定义键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!