Xcode:仅为我自己的应用程序创建自定义键盘

编程入门 行业动态 更新时间:2024-10-27 22:29:54
本文介绍了Xcode:仅为我自己的应用程序创建自定义键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发数学应用程序.所以我需要一个特定的键盘. 我只是可以使用小数点,但是缺少正/负("+/-")按钮.

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:仅为我自己的应用程序创建自定义键盘

本文发布于:2023-11-12 03:25:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580371.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自己的   仅为   自定义   应用程序   键盘

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!