I have a chat app. The bubble chat inside a UITableViewCell
is composed by a UIImageView
(the bubble) and a UITextView
created programmatically and it has DataDetectorTypes
to detect phone numbers and links. When I have the link in the beginning of the text or the link alone in the cell everything works perfectly, but my problem is when the link is at the end of the UITextView
. It gets detect as a link but the click on the link doesn't work.
I have created the UITextView
like that:
[self.messageLabel setBackgroundColor:[UIColor clearColor]];
[self.messageLabel setFont:[UIFont fontWithName:@"Helvetica" size:15]];
[self.messageLabel setText:nil];
[self.messageLabel setEditable:NO];
[self.messageLabel setSelectable:YES];
[self.messageLabel setScrollEnabled:NO];
[self.messageLabel setDelaysContentTouches:NO];
[self.messageLabel setDataDetectorTypes:(UIDataDetectorTypePhoneNumber|UIDataDetectorTypeLink)];
[self.messageLabel setTextAlignment:NSTextAlignmentLeft];
Can anyone help me?
try again after increase row height of a cell in [tableView:heightForRowAtIndexPath].
If it works, you need to change of height of cell dynamically.