Further improved label dynamic sizing.

This commit is contained in:
Christiano, Kevin 2019-06-20 09:20:45 -04:00
parent 353f8cd301
commit 9cfa00c533

View File

@ -73,8 +73,9 @@ import Foundation
if leftTextLabel.hasText && rightTextLabel.hasText {
let padding = MFStyler.defaultHorizontalPadding(forSize: size) * 2
let maximumTextWidth = (size - (padding + 16)) * 0.4
rightTextLabel.preferredMaxLayoutWidth = round(maximumTextWidth)
} else {
// Subtracting 10 resolves issues of SE and iPad
rightTextLabel.preferredMaxLayoutWidth = round(maximumTextWidth) - 10
} else {
rightTextLabel.preferredMaxLayoutWidth = 0
}
}