blob: 4a73fc031f26ddc348827147ef3846ff752183d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#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
|