From 8ca62a8d447130392fb0b32d3c3e778c3aa632a1 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 19 Apr 2018 21:01:45 -0400 Subject: [PATCH] Align top row by baseline // FREEBIE --- Signal/src/ViewControllers/HomeView/HomeViewCell.m | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Signal/src/ViewControllers/HomeView/HomeViewCell.m b/Signal/src/ViewControllers/HomeView/HomeViewCell.m index d47bbde92..a69c40451 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewCell.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewCell.m @@ -103,7 +103,7 @@ NS_ASSUME_NONNULL_BEGIN self.dateTimeLabel, ]]; self.topRowView.axis = UILayoutConstraintAxisHorizontal; - self.topRowView.alignment = UIStackViewAlignmentBottom; + self.topRowView.alignment = UIStackViewAlignmentLastBaseline; [self.payloadView addArrangedSubview:self.topRowView]; self.snippetLabel = [UILabel new]; @@ -189,11 +189,8 @@ NS_ASSUME_NONNULL_BEGIN } else { [self.contentView addSubview:self.unreadBadge]; - self.unreadLabel.text = [OWSFormat formatInt:unreadCount]; + self.unreadLabel.text = [OWSFormat formatInt:(int)unreadCount]; - // TODO: Will this localize? It assumes that the worst case - // unread count (99) will fit horizontally into some multiple - // N of the font's line height. const int unreadBadgeHeight = (int)ceil(self.unreadLabel.font.lineHeight * 1.5f); self.unreadBadge.layer.cornerRadius = unreadBadgeHeight / 2;