将中文手写键盘插入应用程序视图
我想将中文手写键盘嵌入到我的应用程序的视图中。也就是说,我不希望它连接到真正的键盘。事实上,我什至不希望它对用户可见。我希望用户能够在空白屏幕的中央手写,并在完成后在屏幕上输出汉字。这可能吗?
i would like to sort of embed the chinese handwriting keyboard into a view in my app. That is to say, i don't want it connected to the real keyboard. In fact, I don't even want it visible to the user. I'd like the user to simply be able to handwrite in the center of a blank screen, and have a chinese character output on the screen after completion. is this even possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
支持手写的唯一方法是编写一个永远不会成为firstResponder的视图(防止键盘出现),userInteractionEnabled = YES(获取触摸),并使用touchesMoved在用户移动手指时绘制字符。
您可以通过从 UITextView 和类似的文本输入视图。
The only way you could support handwriting would be to write a view which never became firstResponder (preventing the keyboard from appearing), userInteractionEnabled=YES (to get touches), and uses the touchesMoved to draw the characters as the user moves their finger.
You can implement a custom keyboard by returning a custom keyboard UIView from the
inputView
property on UITextView and similar text input views.