问题标签 [custom-keyboard]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
780 浏览

uiwebview - 文本字段保留在 iOS 8 的 UIWebView 中的自定义键盘下

我正在为 iOS 创建一个网络应用程序,并且我有一个自定义键盘。当我使用默认键盘时,它会立即显示键盘,并且文本字段位于键盘上方。如果我将键盘更改为我的自定义键盘,我会得到相同的结果。但问题是我在启用自定义键盘时将焦点放在文本字段上。它有一些延迟加载,当它加载时,文本字段停留在键盘下方。这是我的自定义键盘代码:

CustomKeyboardView 类的实现类似于这个库。任何帮助,将不胜感激。

0 投票
2 回答
727 浏览

objective-c - 自定义键盘应用程序扩展 iOS 8 上的 Siri

目前我正在开发一个 iOS 8 自定义键盘扩展,我想模仿 Siri 的功能,类似于默认键盘。

我们可以在 iOS 8 自定义键盘应用扩展上使用 Siri 吗?如果可以的话,是否有任何可用的 API/文档?

谢谢

0 投票
2 回答
2737 浏览

ios - iOS8 自定义键盘问题

我现在正在开发 iOS 8 自定义键盘扩展,并且有一些我无法弄清楚的问题。

首先,我认为这些UITextInputDelegate方法没有像我预期的那样工作。

这听起来对吗:当用户长按输入区域selectionWillChange:selectionDidChange:应该调用方法?每当文本发生变化时,都应该调用textWillChange:and方法?textDidChange:

实际上,我观察到的是,当我在文本输入区域中更改选择textWillChange:并被textDidChange:调用时,我无法知道其他两种方法是在什么条件下调用的。如果有人知道这些委托方法的用法,请告诉我。

其次,我知道该playInputClick:方法可用于在自定义键盘中虚拟化键盘点击声音。由于这适用于正常情况,我发现无法在 iOS 8 自定义键盘扩展中应用。我的应用由一个键盘视图控制器组成,子类 UIView 的自定义视图被添加到这个视图控制器中。我的方法是UIInputViewAudioFeedback在这个自定义视图中声明委托, enableInputClicksWhenVisible 方法正在返回YES,设置调用[[UIDevice currentDevice] playInputClick]的类方法,然后在需要键盘声音的地方调用此方法:这根本不起作用。

我的方法有任何错误吗?如果有人成功使用playInputClick方法,请分享您的智慧。

谢谢

0 投票
2 回答
2068 浏览

ios8 - UITextInputDelegate methods not functioning correctly

I'm working on iOS 8 custom keyboard extension right now, and there are some issues in using UITextInputDelegate Methods.

Does this right: selectionWillChange: and selectionDidChange: methods should be called when user long-presses typing area? And textWillChange: and textDidChange: methods should be called whenever the text is literally changing?

Actually, what I observed is that, when I changed selection in text input area, textWillChange: and textDidChange: are called, and I cannot get a clue that the other two methods are called in what condition. If anyone knows about the usage of these delegate methods, please let me know.

0 投票
4 回答
9626 浏览

ios - 如何在 iOS 8 的扩展中知道当前的 interfaceOrientation?

UIViewController 的 InterfaceOrientation 已弃用,文档建议使用[[UIApplication sharedApplication] statusBarOrientation],但 iOS 8 的扩展中没有 sharedApplication 。


正如@Retro 提到的,在大多数情况下,您可以使用self.traitCollection.verticalSizeClassself.traitCollection.horizontalSizeClass在 UIViewController 中获取方向信息。

0 投票
1 回答
491 浏览

ios8 - 在包含应用程序和自定义键盘的 iOS8 之间共享图像

在包含应用程序和自定义键盘之间发送图像的最佳方式是什么?有苹果谈论的最佳实践吗?苹果会讨厌一种骇人听闻的方式吗?是否已经有人在 github 中构建了一个框架来帮助这个?谢谢!

0 投票
1 回答
574 浏览

objective-c - Storing data in custom keyboard

I am building a custom keyboard that learns the way you type for smarter auto-correct. In order to learn...

I need to be able to STORE data to the users device. I've tried using NSFileManager with NSDocumentsDirectory but nothing is getting saved int he AppExtension. (I tested the code (copy paste) in a regular app (non-app-extension) and it worked). I even enabled "Requests Open Access" in the .plist and re-installed the keyboard... still wouldn't save data.

Is there a way to store data in an app-extension?


Possible solutions I've pondered:

•Maybe creating a contact in the users address book that has my info in it (if app-extensions are allowed to do that), but a user might be suspicious as to why my app is requesting permission to modify their contact's address book).

•Displaying a hidden UIWebView that uses javascript injection to store and read data Safari Javascript Database, but I'm afraid this data might be erased if cache is ever cleared.

0 投票
2 回答
1539 浏览

ios - 检测是否已安装自定义键盘

我已经阅读了文档,似乎找不到任何方法来检测是否在设置>常规>键盘中安装了自定义键盘?

有人知道吗?

0 投票
1 回答
1273 浏览

ios - 在 iOS 8 中将 QuickType (Predictive) 添加到自定义键盘

我正在 iOS 8 中制作自定义键盘。我在键盘中看到 Apple 具有快速输入功能(预测:打开)以快速输入文本有没有办法将此功能添加到我的键盘?请帮我 !非常感谢

0 投票
1 回答
223 浏览

ios8 - 无法在实际设备上激活 ios8 自定义键盘

我为 iOS8 设计了一个自定义键盘,它在模拟器上运行良好,但是当我将 iPad 连接到 Xcode 以在我的设备上安装应用程序时,它不会在键盘列表下显示我的自定义键盘。我究竟做错了什么?我的键盘的实现可以在这里找到。 在此处输入图像描述