簡體   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