iOS: Preferably truncate feed title rather than statistic text in organizer/mute.

Without this, long feed titles often mean you can’t see the statistic at all.
This commit is contained in:
Nicholas Riley 2016-02-06 14:22:08 -05:00
parent d31562585e
commit 2d25e4c4a5

View file

@ -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