Index: ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm |
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm b/ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm |
index 3196ae46d7e506a5e86867ed79bd9de53bb63bde..42d4a3af7d0aadd510d6c52e9034e158c490981f 100644 |
--- a/ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm |
+++ b/ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm |
@@ -34,6 +34,7 @@ const CGFloat kAppendButtonSize = 48.0; |
@synthesize textTruncatingLabel = _textTruncatingLabel; |
@synthesize detailTruncatingLabel = _detailTruncatingLabel; |
+@synthesize detailAnswerLabel = _detailAnswerLabel; |
@synthesize appendButton = _appendButton; |
@synthesize answerImageView = _answerImageView; |
@synthesize imageView = _imageView; |
@@ -66,6 +67,14 @@ const CGFloat kAppendButtonSize = 48.0; |
_detailTruncatingLabel.userInteractionEnabled = NO; |
[self addSubview:_detailTruncatingLabel]; |
+ // Answers use a UILabel with NSLineBreakByTruncatingTail to produce a |
+ // truncation with an ellipse instead of fading on multi-line text. |
+ _detailAnswerLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
rohitrao (ping after 24h)
2017/03/02 18:18:31
How does the frame for this label (and all the oth
Justin Donnelly
2017/03/02 18:52:05
The layout of these labels is done in OmniboxPopup
|
+ _detailAnswerLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth; |
+ _detailAnswerLabel.userInteractionEnabled = NO; |
+ _detailAnswerLabel.lineBreakMode = NSLineBreakByTruncatingTail; |
+ [self addSubview:_detailAnswerLabel]; |
+ |
_appendButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; |
[_appendButton setContentMode:UIViewContentModeRight]; |
[self updateAppendButtonImages]; |
@@ -164,7 +173,9 @@ const CGFloat kAppendButtonSize = 48.0; |
} |
- (NSString*)accessibilityValue { |
- return _detailTruncatingLabel.attributedText.string; |
+ return _detailTruncatingLabel.hidden |
+ ? _detailAnswerLabel.attributedText.string |
+ : _detailTruncatingLabel.attributedText.string; |
} |
@end |