我正在尝试更新具有聊天界面的 iOS8 应用程序,但新的 Quicktype 键盘隐藏了 TextView ,因此我想以编程方式或在界面生成器中将其关闭。
是否有可能以某种方式或只有用户可以在设备设置中将其关闭?
我知道有一个问题/答案可以用 UITextfield
解决这个问题,但我需要用 UITextView
来解决这个问题。
最佳答案
您可以禁用 UITextView 的键盘建议/自动完成/QuickType,这可以阻止像 4S 这样的小屏幕上的文本,如本例所示
下面一行:
myTextView.autocorrectionType = UITextAutocorrectionTypeNo;
如果您只想在特定屏幕上执行此操作,例如定位 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/