fixed layout issues

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-16 08:27:11 -05:00
parent d1a74ea387
commit 0f8ab50192
2 changed files with 12 additions and 3 deletions

View File

@ -27,7 +27,14 @@ open class Loader: View {
open var isActive: Bool = true { didSet { setNeedsUpdate() } }
/// The Int used to determine the height and width of the Loader
open var size: Int = 40 { didSet { setNeedsUpdate() } }
open var size: Int = 40 {
didSet {
setNeedsUpdate();
invalidateIntrinsicContentSize()
}
}
open override var intrinsicContentSize: CGSize { .init(width: size, height: size) }
//--------------------------------------------------
// MARK: - Lifecycle

View File

@ -43,7 +43,7 @@ open class TitleLockup: View {
private var stackView = UIStackView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.axis = .vertical
$0.distribution = .fill
$0.distribution = .fillProportionally
}
private var otherStandardStyle: OtherStandardStyle {
@ -311,7 +311,6 @@ open class TitleLockup: View {
eyebrowLabel.attributes = eyebrowModel.textAttributes
eyebrowLabel.numberOfLines = eyebrowModel.numberOfLines
eyebrowLabel.surface = surface
//When uniform size is true
if let titleModel, isUniformSize {
if titleModel.isBold {
@ -329,6 +328,7 @@ open class TitleLockup: View {
eyebrowLabel.textColorConfiguration = textColorPrimaryConfiguration
eyebrowLabel.textStyle = eyebrowModel.isBold ? otherStandardStyle.value.bold : otherStandardStyle.value.regular
}
eyebrowLabel.sizeToFit()
} else {
eyebrowLabel.reset()
}
@ -341,6 +341,7 @@ open class TitleLockup: View {
titleLabel.attributes = titleModel.textAttributes
titleLabel.numberOfLines = titleModel.numberOfLines
titleLabel.surface = surface
titleLabel.sizeToFit()
} else {
titleLabel.reset()
}
@ -354,6 +355,7 @@ open class TitleLockup: View {
subTitleLabel.attributes = subTitleModel.textAttributes
subTitleLabel.numberOfLines = subTitleModel.numberOfLines
subTitleLabel.surface = surface
subTitleLabel.sizeToFit()
} else {
subTitleLabel.reset()
}