在UITextView上以编程方式禁用iOS8 Quicktype键盘 [英] Disable iOS8 Quicktype Keyboard programmatically on UITextView

查看:214
本文介绍了在UITextView上以编程方式禁用iOS8 Quicktype键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更新iOS8的应用程序,它有一个聊天界面,但新的Quicktype键盘隐藏了文本视图,因此我想以编程方式或在界面构建器中关闭它。

I'm trying to update an app for iOS8, which has a chat interface, but the new Quicktype keyboard hides the text view, so I would like to turn it off programmatically or in interface builder.

是否有可能或者只有用户可以在设备设置中将其关闭?

Is it possible somehow or only the users can turn it off in the device settings?

我知道有一个问题/答案用 UITextfield 解决了这个问题,但我需要这样做使用 UITextView

I know there is a question/answer which solves this problem with a UITextfield, but I need to do it with a UITextView.

推荐答案

您可以禁用键盘建议/自动完成功能/ QuickType为UITextView可以阻止像4S这样的小屏幕上的文本,如本例所示

You may disable the keyboard suggestions / autocomplete / QuickType for a UITextView which can block the text on smaller screens like the 4S as shown in this example

,其中包含以下行:

myTextView.autocorrectionType = UITextAutocorrectionTypeNo;

如果你想在特定的屏幕上进行此操作,例如定位4S

And further if youd like to do this only on a specific screen such as targeting the 4S

if([[UIDevice currentDevice]userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
    CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
    if (screenHeight == 568) {
        // iphone 5 screen
    }
    else if (screenHeight < 568) {
       // smaller than iphone 5 screen thus 4s
    }
}

这篇关于在UITextView上以编程方式禁用iOS8 Quicktype键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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