iOS 自定义键盘的键盘关闭按钮

标签 ios objective-c keyboard ios-app-extension

我正在为 iOS 8 创建自定义键盘扩展。我正在尝试实现关闭/隐藏键盘按钮。我正在使用 UITextDocumentProxy 来编辑文本并插入字符。我怎样才能实现这样的事情:

[textView resignFirstResponder];

但是对于self.textDocumentProxy

最佳答案

文档说:使用- dismissKeyboard方法。

Because a custom keyboard does not have access to the current text input object, you cannot send it a resignFirstResponder message (as you would to dismiss the system keyboard when you are developing an app with text entry). To dismiss the custom keyboard, call dismissKeyboard instead.

关于iOS 自定义键盘的键盘关闭按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25294247/

相关文章:

ios - `someVar` 或单引号在 swift 中是什么意思

ios - 渐变色作为 Swift4 中 UIButton 的背景色

ios - IOS swift 中的 3D 立方体过渡

iphone - iOS 智能卡接口(interface)

ios - 如何解决 Swift 3 中的键盘问题?

中间有数字键盘的键盘?

objective-c - 使一系列按钮的响应都不同

iphone - 如何在iOS5中获取静默开关状态

objective-c - 如何使用核心数据设置 NSArrayController?

react-native - 警告 : Functions are not valid as a React child.( react 原生)