ios - 在 UITextView 上隐藏 "Selection Preview"插入符

标签 ios objective-c uitextarea

我很难用谷歌搜索这个,因为我不确定该怎么调用它,但这是一张截图。

Strange selection caret on my UITextView

问题是我有一个大字体大小的用户可编辑 UITextView。我正在这样创建和添加它:

UITextView *textView1 = [[UITextView alloc] initWithFrame:(CGRect){0,0,700,200}];
textView1.text = @"THANK YOU";
textView1.font = [UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:95.0];
textView1.textColor = [UIColor whiteColor];
textView1.backgroundColor = [UIColor clearColor];
textView1.textAlignment = NSTextAlignmentCenter;
[self.innerContainerView addSubview:textView1];
[textView1 sizeToFit];
textView1.frame = CGRectInset(textView1.frame, -20, 0);
textView1.center = (CGPoint){self.innerContainerView.frame.size.width / 2, self.innerContainerView.frame.size.height / 2};
textView1.delegate = self;

在用户选择特定字符范围之前,一切正常。拖动选择句柄时会出现这个(大部分)空插入符号。看起来这通常会向您显示所选文本的稍微放大的预览,但在这里它是无用且丑陋的。有没有办法禁用此工具?它甚至叫什么?

最佳答案

试试这个:

yourTextView.autocorrectionType = UITextAutocorrectionTypeNo;

关于ios - 在 UITextView 上隐藏 "Selection Preview"插入符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22773031/

相关文章:

ios - 如何通过 iTunes 链接或 Google 搜索使 UIImageView 可点击(可触摸)

ios - 为什么 xCode 会四处移动我的对象?

objective-c - 如何调用 UItableview 委托(delegate)方法。 tableview什么时候在 "for"循环?

ios - 当我只是将数据存储在内存中(而不是磁盘)时,如何有效地删除我的核心数据存储?

ios - 如何使用 CKModifyRecordsOperation.perRecordProgressBlock 更新进度

java.awt : Second TextArea is not shown

ios - 授予使用位置服务的权限后 map 未更新

ios "has active assertions beyond permitted time:"异步任务崩溃