gpt4 book ai didi

iOS 8 :custom Keyboard with undo and redo button

转载 作者:可可西里 更新时间:2023-11-01 05:53:52 28 4
gpt4 key购买 nike

我开发了一个 IOS 8 自定义键盘。我想给它“撤消”和“重做”功能,就像默认的系统键盘一样。我尝试过不同的方法,但无法找到好的解决方案。

我们可以使用方法与文本输入对象 textDocumentProxy 进行交互

insertText
deleteBackward
documentContextAfterInput
ocumentContextBeforeInput

但我无法找到任何实现“撤消”和“重做”功能的方法。

最佳答案

我认为我们可以实现这些功能(撤消、重做)

根据 https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html

Because a custom keyboard can draw only within the primary view of its UIInputViewController object, it cannot select text. Text selection is under the control of the app that is using the keyboard. If that app provides an editing menu interface (such as for Cut, Copy, and Paste), the keyboard has no access to it. A custom keyboard cannot offer inline autocorrection controls near the insertion point.

我认为有很多情况是textfield的内容改变了,你无法知道它什么时候改变的,它是如何改变的。如果我们不知道,我们也无法知道撤消到哪里。我想是的。

我正在像您一样开发自定义键盘扩展,但我遇到了很多问题。 (例如:我们如何才能知道当前光标以获得当前文本选择...)

我的问题:Current text selection in CustomKeyBoardExtension (希望有人知道)

关于iOS 8 :custom Keyboard with undo and redo button,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24803319/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com