VCV updated to account for directionalLayoutMargins. LRLabel improved. Needs slight adjustment for iPhone SE.

This commit is contained in:
Christiano, Kevin 2019-06-19 16:49:07 -04:00
parent f23cee6ba9
commit 353f8cd301
2 changed files with 6 additions and 1 deletions

View File

@ -72,7 +72,7 @@ import Foundation
// Resolves text layout issues found between both dynamically sized labels, number is not exact but performs as required.
if leftTextLabel.hasText && rightTextLabel.hasText {
let padding = MFStyler.defaultHorizontalPadding(forSize: size) * 2
let maximumTextWidth = (size - (padding + 16 + layoutMargins.left + layoutMargins.right)) * 0.4
let maximumTextWidth = (size - (padding + 16)) * 0.4
rightTextLabel.preferredMaxLayoutWidth = round(maximumTextWidth)
} else {
rightTextLabel.preferredMaxLayoutWidth = 0

View File

@ -274,6 +274,11 @@
[super setupView];
self.translatesAutoresizingMaskIntoConstraints = NO;
self.backgroundColor = [UIColor clearColor];
if (@available(iOS 11.0, *)) {
self.directionalLayoutMargins = NSDirectionalEdgeInsetsZero;
} else {
self.layoutMargins = UIEdgeInsetsZero;
}
}
- (void)updateView:(CGFloat)size {