VCV updated to account for directionalLayoutMargins. LRLabel improved. Needs slight adjustment for iPhone SE.
This commit is contained in:
parent
f23cee6ba9
commit
353f8cd301
@ -72,7 +72,7 @@ import Foundation
|
|||||||
// Resolves text layout issues found between both dynamically sized labels, number is not exact but performs as required.
|
// Resolves text layout issues found between both dynamically sized labels, number is not exact but performs as required.
|
||||||
if leftTextLabel.hasText && rightTextLabel.hasText {
|
if leftTextLabel.hasText && rightTextLabel.hasText {
|
||||||
let padding = MFStyler.defaultHorizontalPadding(forSize: size) * 2
|
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)
|
rightTextLabel.preferredMaxLayoutWidth = round(maximumTextWidth)
|
||||||
} else {
|
} else {
|
||||||
rightTextLabel.preferredMaxLayoutWidth = 0
|
rightTextLabel.preferredMaxLayoutWidth = 0
|
||||||
|
|||||||
@ -274,6 +274,11 @@
|
|||||||
[super setupView];
|
[super setupView];
|
||||||
self.translatesAutoresizingMaskIntoConstraints = NO;
|
self.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
self.backgroundColor = [UIColor clearColor];
|
self.backgroundColor = [UIColor clearColor];
|
||||||
|
if (@available(iOS 11.0, *)) {
|
||||||
|
self.directionalLayoutMargins = NSDirectionalEdgeInsetsZero;
|
||||||
|
} else {
|
||||||
|
self.layoutMargins = UIEdgeInsetsZero;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateView:(CGFloat)size {
|
- (void)updateView:(CGFloat)size {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user