I have custom UITableViewCells that contain a UITextView. I have link detection in the UITextView turned on in Interface Builder. When I first load the table view, everythin
This one works reliably for me:
// fix url detection bug
cell.textView.dataDetectorTypes = UIDataDetectorTypeNone;
cell.textView.dataDetectorTypes = UIDataDetectorTypeLink;
Changing the Tint color to other color actually works. However if selectable enable the tint will also be the same color.
I also face this problem and I found out to solve this is to set textview properties in the following order,
[textview setDataDetectorTypes:UIDataDetectorTypeNone ];
textView.editable = NO;
[textView setDataDetectorTypes:UIDataDetectorTypeLink];
textView.text=@"The text you need to show with link";
Hope this help you.....
You can fix this issue by using NSAttributedString.
cell.textview.attributedText = [[NSAttributedString alloc] initWithString:message.message];
Several suggestions here and through links provided did not help me with this bug.
I tried setting attributed text, setting text to nil, setting text to @"".
In the end forcing the text view in an out of editable mode did the trick. In prepare for reuse
- (void)prepareForReuse
{
...
textView.editable = YES;
textView.editable = NO;
...
}
textView.text = nil;
textView.attributedText = nil;
textView.attributedText = [[NSAttributedString alloc] initWithString:@"your new string"];