ios – 如何在长按键盘上显示额外的字符

前端之家收集整理的这篇文章主要介绍了ios – 如何在长按键盘上显示额外的字符前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何长按虚拟键盘上的键,如何添加额外字符,如下图所示:

我正在使用this library.

解决方法

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问题.这些答案可以帮助您决定做什么.

猜你在找的iOS相关文章