From 2d25e4c4a5cd8ddb14450dd1b0deba185ac2581c Mon Sep 17 00:00:00 2001 From: Nicholas Riley Date: Sat, 6 Feb 2016 14:22:08 -0500 Subject: [PATCH] iOS: Preferably truncate feed title rather than statistic text in organizer/mute. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, long feed titles often mean you can’t see the statistic at all. --- clients/ios/Classes/FeedChooserViewCell.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/clients/ios/Classes/FeedChooserViewCell.m b/clients/ios/Classes/FeedChooserViewCell.m index 5bf290a1f..ab22d8fd4 100644 --- a/clients/ios/Classes/FeedChooserViewCell.m +++ b/clients/ios/Classes/FeedChooserViewCell.m @@ -65,6 +65,19 @@ self.backgroundColor = UIColorFromRGB(0xFFFFFF); self.backgroundView.backgroundColor = UIColorFromRGB(0xFFFFFF); self.selectedBackgroundView.backgroundColor = UIColorFromRGB(0xECEEEA); + + CGFloat detailTextLabelWidth = self.detailTextLabel.attributedText.size.width; + CGRect detailTextLabelFrame = self.detailTextLabel.frame; + CGFloat detailTextLabelExtraWidth = detailTextLabelWidth - detailTextLabelFrame.size.width; + if (detailTextLabelExtraWidth > 0) { + detailTextLabelFrame.origin.x -= detailTextLabelExtraWidth; + detailTextLabelFrame.size.width = detailTextLabelWidth; + self.detailTextLabel.frame = detailTextLabelFrame; + + CGRect textLabelFrame = self.textLabel.frame; + textLabelFrame.size.width -= detailTextLabelExtraWidth; + self.textLabel.frame = textLabelFrame; + } } @end