解决方法
Apple为自定义键盘
here提供了一个解释清楚的编程指南.
根据该指南:
These features and others are listed next.
- Appropriate layout and features based on keyboard type trait
- Autocorrection and suggestion
- Automatic capitalization
- Automatic period upon double space
- Caps lock support
- Keycap artwork
- Multistage input for ideographic languages
You can decide whether or not to implement such features; there is no
dedicated API for any of the features just listed,so providing them
is a competitive advantage.
您的关键字是Keycap图稿.
所以,就像他们说的那样,没有专门的api.您可以使用已知的常规方法进行设计.比如,在字母按钮上添加点击手势识别器,并且在长按字母时显示一些视图包括字母按钮的右上边缘的额外字符.
或者,您可以创建包含自定义字符的第二个键盘,并允许用户在默认键盘和您的键盘之间切换.
更新:
我还发现了this问题.这些答案可以帮助您决定做什么.