有没有办法替换 iOS 8 自定义键盘扩展中的预测文本源并显示在预测文本栏中?预测文本栏的类别是什么?
非常感谢。我已阅读文档但找不到答案。请帮忙。
最佳答案
1) 您可以使用 UILexicon,从技术上讲,它是包含在 UILExiconEntry 对象中的键值对字符串的字典
苹果给出了“Iphone”变成“iPhone”和“Nur”变成“Nur N. Eytan”(来自你的地址簿)等的例子。
但你可以做出更智能的东西。
例如,一个聪明的做法是创建一个开源项目,该项目接受字符串的 JSON 并将其转换为 UILexicon :) 我会使用它!
2) Apple give you 320 pixels width and ±215 pixels height for your keyboard.
You are prohibited and technically can't draw outside of these boundaries. What all the companies releasing custom keyboards did was reduce the size of the keys in 20%-25% in order to add a candidate view (predictive text bar)
编辑:您可以在 iOS8.0 上调整键盘的高度 - 这是一个很好的指针: iOS 8 Custom Keyboard: Changing the Height
祝你好运!
关于ios - 替换自定义键盘中预测文本的来源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24444014/