ios - 在 UITextView 上以编程方式禁用 iOS8 Quicktype 键盘

标签 ios objective-c xcode ios8

我正在尝试更新具有聊天界面的 iOS8 应用程序,但新的 Quicktype 键盘隐藏了 TextView ,因此我想以编程方式或在界面生成器中将其关闭。

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

我知道有一个问题/答案可以用 UITextfield 解决这个问题,但我需要用 UITextView 来解决这个问题。

最佳答案

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

下面一行:

myTextView.autocorrectionType = UITextAutocorrectionTypeNo;

enter image description here enter image description here

如果您只想在特定屏幕上执行此操作,例如定位 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
    }
}

关于ios - 在 UITextView 上以编程方式禁用 iOS8 Quicktype 键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25951274/

相关文章:

c - “notestofile”功能不起作用

ios - 在 Xcode UITest 中访问 app.buttons 而无需任何可用的文本供引用。

ios - UiCollectionViewCell 随机图片翻转

ios - GTMHTTPFetcher.m 'initWithRequest:delegate:start Immediately:' 已弃用 : first deprecated in iOS 9. 0 - 使用 NSURLSession(参见 NSURLSession.h)

ios - ios 13 之后的 future iOS 版本是否仍支持 Storyboard?

ios - 当应用程序进入 iOS 后台时,我的 AppDelegate 中的 @property 变为 null

swift - SpriteKit 场景节点比例说明

xcode - 发送到应用商店后,无法在我的 iPad 上运行原始的 xcode 项目

tableView heightForRowAtIndexPath 中的 iOS UITableView numberOfRowsInSection 给出 BAD ACCESS

objective-c - 使用 UIViewController 作为协议(protocol)