mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Fix data detector leaking into reused cells in chat view
This commit is contained in:
parent
f12acd5e7e
commit
03b8d2b357
1 changed files with 9 additions and 7 deletions
|
|
@ -97,11 +97,6 @@ static UIFont *CELL_FONT = nil;
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)prepareForReuse {
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)setChatMessage:(LinphoneChatMessage *)message {
|
||||
|
|
@ -156,8 +151,15 @@ static UIFont *CELL_FONT = nil;
|
|||
} else {
|
||||
// simple text message
|
||||
[messageText setHidden:FALSE];
|
||||
[messageText setText:[NSString stringWithUTF8String:text]];
|
||||
|
||||
/* We need to use an attributed string here so that data detector don't mess
|
||||
* with the text style. See http://stackoverflow.com/a/20669356 */
|
||||
NSAttributedString* attr_text = [[NSAttributedString alloc]
|
||||
initWithString:[NSString stringWithUTF8String:text]
|
||||
attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17.0],
|
||||
NSForegroundColorAttributeName:[UIColor darkGrayColor]}];
|
||||
messageText.attributedText = attr_text;
|
||||
[attr_text release];
|
||||
|
||||
[messageImageView setImage:nil];
|
||||
[messageImageView setHidden:TRUE];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue