ios - 替换自定义键盘中预测文本的来源

标签 ios keyboard swift ios8 ios-app-extension

有没有办法替换 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/

相关文章:

ios - 尝试播放音频时出现 swift_unexpectedError

iOS 如何在inputview改变时获取键盘高度?

javascript - 通过触发输入焦点打开 iOS 键盘

ios - 禁用键盘上的键

swift - 为 PFObject 设置 equatable

Swift:根据另一个属性从 Parse.com 检索对象值

ios - 如何从 ios 上的 m3u8 直播中获取缩略图?

ios - EXC_BAD_ACCESS,代码 1,iOS 7.0.x 64 位设备

ios - SwiftUI:在 TabView 中调整图像的位置

ios - 将一个导航栏更改为透明会将所有导航栏更改为透明