繁体   English   中英

UITableViewCell内部的UITextView中的链接检测-iOS 7

[英]Link detection in a UITextView inside a UITableViewCell - iOS 7

我有一个聊天应用程序。 UITableViewCell内的气泡聊天由UIImageView (气泡)和以编程方式创建的UITextView组成,并且具有用于检测电话号码和链接的DataDetectorTypes 当我将链接放在文本开头或将链接单独放在单元格中时,一切都将正常运行,但是我的问题是,当链接位于UITextView的末尾时。 它被检测为链接,但单击链接不起作用。

我创建了这样的UITextView

[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];

谁能帮我?

[tableView:heightForRowAtIndexPath].增加单元格的行高后重试[tableView:heightForRowAtIndexPath].

如果可行,则需要动态更改单元格的高度。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM