diff --git a/iphone/Maps/Bookmarks/MWMCategoryInfoCell.mm b/iphone/Maps/Bookmarks/MWMCategoryInfoCell.mm index 84e84c5092..5486c73b44 100644 --- a/iphone/Maps/Bookmarks/MWMCategoryInfoCell.mm +++ b/iphone/Maps/Bookmarks/MWMCategoryInfoCell.mm @@ -10,11 +10,12 @@ @property (weak, nonatomic) IBOutlet UILabel * titleLabel; @property (weak, nonatomic) IBOutlet UILabel * authorLabel; -@property (weak, nonatomic) IBOutlet UILabel * infoLabel; @property (weak, nonatomic) IBOutlet UIButton * moreButton; +@property (weak, nonatomic) IBOutlet UITextView * infoTextView; @property (weak, nonatomic) IBOutlet NSLayoutConstraint * infoToBottomConstraint; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * infoHeightConstraint; -@property (copy, nonatomic) NSString * info; +@property (copy, nonatomic) NSAttributedString * info; @property (copy, nonatomic) NSString * shortInfo; @property (weak, nonatomic) id delegate; @@ -27,18 +28,22 @@ [super awakeFromNib]; self.titleLabel.text = nil; self.authorLabel.text = nil; - self.infoLabel.text = nil; + self.infoTextView.text = nil; } - (void)setExpanded:(BOOL)expanded { _expanded = expanded; if (self.shortInfo.length > 0 && self.info.length > 0) - self.infoLabel.text = expanded ? self.info : self.shortInfo; - else - self.infoLabel.numberOfLines = expanded ? 0 : 2; + { + if (expanded) + self.infoTextView.attributedText = self.info; + else + self.infoTextView.text = self.shortInfo; + } self.infoToBottomConstraint.active = expanded; + self.infoHeightConstraint.active = !expanded; self.moreButton.hidden = expanded; } @@ -49,21 +54,24 @@ self.titleLabel.text = @(GetPreferredBookmarkStr(data.m_name).c_str()); self.authorLabel.text = [NSString stringWithCoreFormat:L(@"author_name_by_prefix") arguments:@[@(data.m_authorName.c_str())]]; - auto info = @(GetPreferredBookmarkStr(data.m_description).c_str()); + auto infoHtml = @(GetPreferredBookmarkStr(data.m_description).c_str()); + auto info = [NSAttributedString stringWithHtml:infoHtml + defaultAttributes: @{NSFontAttributeName : [UIFont regular14], + NSForegroundColorAttributeName: [UIColor blackPrimaryText]}]; auto shortInfo = @(GetPreferredBookmarkStr(data.m_annotation).c_str()); if (info.length > 0 && shortInfo.length > 0) { self.info = info; self.shortInfo = shortInfo; - self.infoLabel.text = shortInfo; - self.infoLabel.numberOfLines = 0; + self.infoTextView.text = shortInfo; } - else if (info.length > 0 || shortInfo.length > 0) + else if (info.length > 0) { - self.infoLabel.text = info.length > 0 ? info : shortInfo; + self.infoTextView.attributedText = info; } else { + self.infoTextView.text = shortInfo; self.expanded = YES; } } @@ -73,7 +81,7 @@ [super prepareForReuse]; self.titleLabel.text = nil; self.authorLabel.text = nil; - self.infoLabel.text = nil; + self.infoTextView.text = nil; self.expanded = NO; self.info = nil; self.shortInfo = nil; diff --git a/iphone/Maps/Bookmarks/MWMCategoryInfoCell.xib b/iphone/Maps/Bookmarks/MWMCategoryInfoCell.xib index 1c3aa2e6f6..2dd58e9275 100644 --- a/iphone/Maps/Bookmarks/MWMCategoryInfoCell.xib +++ b/iphone/Maps/Bookmarks/MWMCategoryInfoCell.xib @@ -1,11 +1,11 @@ - + - + @@ -37,15 +37,24 @@ - +