在 iPhone 中自定义数字键盘

发布于 2024-10-05 03:26:33 字数 114 浏览 0 评论 0原文

我需要在数字键盘中添加取消按钮。如何自定义以下键盘?当我点击取消按钮时,键盘将被隐藏。

替代文本

I need to add cancel button in numeric keyboard. How to customize the following keyboard? When I click by cancel button, the keyboard will be hide.

alt text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故人如初 2024-10-12 03:26:33

输入附件视图是一个视图位于键盘顶部。它必须是键盘的宽度并且高度是可调的。

在此视图上,您​​可以添加一个按钮,按下该按钮后,UITextFieldResignFirstResponder 就会出现,从而为您提供所需的功能。

Input Accessory View is a view that sits on top of the keyboard. It has to the be the width of the keyboard and the height is adjustable.

On this view you could add a button, that when pressed will ResignFirstResponder of the UITextField, thus giving you the funcationality you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文