gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 14:06:41 28 4
gpt4 key购买 nike

我正在尝试更新 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/32301209/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com