UITextView – 如何禁用突出显示?

我禁用了编辑function,但是如何禁止popupselect界面? 我不希望用户能够突出显示文字或复制文字等。

保持垂直滚动很重要。

textView.userInteractionEnabled = NO; 

好吧,如果你需要保持滚动,然后创build一个scrollView,将其设置为sockets,并添加textview。

然后在viewWillAppear中设置textview的高度:

 - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.descriptionTextView.text = @""; // set some text to determine the total height self.descriptionTextView.frame = CGRectMake(self.descriptionTextView.frame.origin.x, self.descriptionTextView.frame.origin.y, self.descriptionTextView.frame.size.width, self.descriptionTextView.contentSize.height); self.descriptionTextView.userInteractionEnabled = NO; //next set new content size for scroll view self.descriptionScrollView.contentSize = CGSizeMake(self.descriptionScrollView.frame.size.width, self.descriptionTextView.frame.origin.y + self.descriptionTextView.frame.size.height); }