iphone - 如何创建自定义键盘

标签 iphone objective-c ios keyboard

如何创建一个自定义键盘/小键盘,当有人点击 UITextField 时会显示?我想显示一个带有 a、b、c、1、2、3 和输入按钮的键盘,仅此而已。键盘应该像标准键盘一样工作和表现(在行为上),但它看起来肯定会有所不同。

我找不到任何示例,我发现最好的方法是使用现有键盘过滤字符,这是一个 Not Acceptable 解决方案。

最佳答案

我认为您正在寻找“Text, Web, and Editing Programming Guide for iOS

The UIKit framework includes support for custom input views and input accessory views. Your application can substitute its own input view for the system keyboard when users edit text or other forms of data in a view. For example, an application could use a custom input view to enter characters from a runic alphabet. You may also attach an input accessory view to the system keyboard or to a custom input view; this accessory view runs along the top of the main input view and can contain, for example, controls that affect the text in some way or labels that display some information about the text.

To get this feature if your application is using UITextView and UITextField objects for text editing, simply assign custom views to the inputView and inputAccessoryView properties. Those custom views are shown when the text object becomes first responder...


这可能是一个很好的介绍:customizing the iOS keyboard

关于iphone - 如何创建自定义键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4643167/

相关文章:

iphone - 在 UIpickerviewcontroller 编辑 View 上添加指令标签

ios - SKMaps iOS : Pin disappears when panning the Map

ios - 当我想使用 tableview.deleteRows(at : , with: ) 时应用程序崩溃

用于操作 NSMutableArray 的 IOS MVC 模式和数据 Controller

ios - Swift - 由于 'textFields' 保护级别,无法访问 'fileprivate'

iphone - 在表格左侧垂直移动表格部分

ios - 在 Xcode 中使用静态库

ios - UILocalNotification唤醒了应用程序(事件)

iOS 框架和类别导入

ios - 如何在 ios 中制作流畅的滑动动画