diff options
author | Ilya Grechuhin <i.grechuhin@mapswithme.com> | 2015-09-14 17:52:41 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:05:35 +0300 |
commit | 231e5de63ce16b255fa39d99947210476e2f8aba (patch) | |
tree | 2784559d2ca4afcf652dfe84495d286efd9be6cb /iphone/Maps/Classes/Components | |
parent | 43e224110313befa5da64d96afa737e7c0c4c218 (diff) |
[ios] Updated search to v2.0.
Diffstat (limited to 'iphone/Maps/Classes/Components')
-rw-r--r-- | iphone/Maps/Classes/Components/MWMMultilineLabel.h | 3 | ||||
-rw-r--r-- | iphone/Maps/Classes/Components/MWMMultilineLabel.m | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/iphone/Maps/Classes/Components/MWMMultilineLabel.h b/iphone/Maps/Classes/Components/MWMMultilineLabel.h new file mode 100644 index 0000000000..737a2639d0 --- /dev/null +++ b/iphone/Maps/Classes/Components/MWMMultilineLabel.h @@ -0,0 +1,3 @@ +@interface MWMMultilineLabel : UILabel + +@end diff --git a/iphone/Maps/Classes/Components/MWMMultilineLabel.m b/iphone/Maps/Classes/Components/MWMMultilineLabel.m new file mode 100644 index 0000000000..63830a6e7b --- /dev/null +++ b/iphone/Maps/Classes/Components/MWMMultilineLabel.m @@ -0,0 +1,20 @@ +#import "MWMMultilineLabel.h" + +@implementation MWMMultilineLabel + +- (void)setBounds:(CGRect)bounds +{ + [super setBounds:bounds]; + + // If this is a multiline label, need to make sure + // preferredMaxLayoutWidth always matches the frame width + // (i.e. orientation change can mess this up) + + if (self.numberOfLines == 0 && bounds.size.width != self.preferredMaxLayoutWidth) + { + self.preferredMaxLayoutWidth = self.bounds.size.width; + [self setNeedsUpdateConstraints]; + } +} + +@end |