iOS UIViewController采用UIKeyInput-是否可以配置为此显示的键盘? [英] IOS UIViewController adopts UIKeyInput - is it possible to configure the keyboard that shows for it?

查看:104
本文介绍了iOS UIViewController采用UIKeyInput-是否可以配置为此显示的键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个视图控制器来采用UIKeyInput,这样我就可以在没有显示文本字段的情况下接受用户输入.我有一个文本框,可以将其用作键盘的输入附件视图,以便用户可以看到该文本.

I have setup a viewcontroller to adopt the UIKeyInput so that I can take user input without a displayed textfield. I have a textfield that is atteched as an input accessory view to the keyboard so the user can see the text.

我在预想性文字方面遇到了问题.我的猜测是,为UIViewController显示的键盘显示了文本,但是当文本字段成为第一响应者时,当在文本字段的键盘上将自动更正设置为否"时,它会迅速将其折叠.

I run into issues with the predictive text. My guess is that the keyboard that shows for the UIViewController shows the text but then when the textfield becomes first responder, it quickly collapses it when autocorrection is set to No on the textfield's keyboard.

关于如何访问和配置成为第一响应者的UIViewController键盘的任何想法?我也希望能够使用不同的键盘类型,因此这不仅是关于自动校正的问题.

Any thoughts on how to access and configure the keyboard for the UIViewController that becomes first responder? I'd like to be able to use the different keyboard types too so its not only a question about the autocorrection.

推荐答案

也实现 UITextInputTraits 协议,您可以使用该协议设置属性以使其具有所需的外观.

Also implement UITextInputTraits protocol, with this you can set the properties to give it the desired appearance.

这篇关于iOS UIViewController采用UIKeyInput-是否可以配置为此显示的键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆