fixed layout issues
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
d1a74ea387
commit
0f8ab50192
@ -27,7 +27,14 @@ open class Loader: View {
|
|||||||
open var isActive: Bool = true { didSet { setNeedsUpdate() } }
|
open var isActive: Bool = true { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
/// The Int used to determine the height and width of the Loader
|
/// 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
|
// MARK: - Lifecycle
|
||||||
|
|||||||
@ -43,7 +43,7 @@ open class TitleLockup: View {
|
|||||||
private var stackView = UIStackView().with {
|
private var stackView = UIStackView().with {
|
||||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||||
$0.axis = .vertical
|
$0.axis = .vertical
|
||||||
$0.distribution = .fill
|
$0.distribution = .fillProportionally
|
||||||
}
|
}
|
||||||
|
|
||||||
private var otherStandardStyle: OtherStandardStyle {
|
private var otherStandardStyle: OtherStandardStyle {
|
||||||
@ -311,7 +311,6 @@ open class TitleLockup: View {
|
|||||||
eyebrowLabel.attributes = eyebrowModel.textAttributes
|
eyebrowLabel.attributes = eyebrowModel.textAttributes
|
||||||
eyebrowLabel.numberOfLines = eyebrowModel.numberOfLines
|
eyebrowLabel.numberOfLines = eyebrowModel.numberOfLines
|
||||||
eyebrowLabel.surface = surface
|
eyebrowLabel.surface = surface
|
||||||
|
|
||||||
//When uniform size is true
|
//When uniform size is true
|
||||||
if let titleModel, isUniformSize {
|
if let titleModel, isUniformSize {
|
||||||
if titleModel.isBold {
|
if titleModel.isBold {
|
||||||
@ -329,6 +328,7 @@ open class TitleLockup: View {
|
|||||||
eyebrowLabel.textColorConfiguration = textColorPrimaryConfiguration
|
eyebrowLabel.textColorConfiguration = textColorPrimaryConfiguration
|
||||||
eyebrowLabel.textStyle = eyebrowModel.isBold ? otherStandardStyle.value.bold : otherStandardStyle.value.regular
|
eyebrowLabel.textStyle = eyebrowModel.isBold ? otherStandardStyle.value.bold : otherStandardStyle.value.regular
|
||||||
}
|
}
|
||||||
|
eyebrowLabel.sizeToFit()
|
||||||
} else {
|
} else {
|
||||||
eyebrowLabel.reset()
|
eyebrowLabel.reset()
|
||||||
}
|
}
|
||||||
@ -341,6 +341,7 @@ open class TitleLockup: View {
|
|||||||
titleLabel.attributes = titleModel.textAttributes
|
titleLabel.attributes = titleModel.textAttributes
|
||||||
titleLabel.numberOfLines = titleModel.numberOfLines
|
titleLabel.numberOfLines = titleModel.numberOfLines
|
||||||
titleLabel.surface = surface
|
titleLabel.surface = surface
|
||||||
|
titleLabel.sizeToFit()
|
||||||
} else {
|
} else {
|
||||||
titleLabel.reset()
|
titleLabel.reset()
|
||||||
}
|
}
|
||||||
@ -354,6 +355,7 @@ open class TitleLockup: View {
|
|||||||
subTitleLabel.attributes = subTitleModel.textAttributes
|
subTitleLabel.attributes = subTitleModel.textAttributes
|
||||||
subTitleLabel.numberOfLines = subTitleModel.numberOfLines
|
subTitleLabel.numberOfLines = subTitleModel.numberOfLines
|
||||||
subTitleLabel.surface = surface
|
subTitleLabel.surface = surface
|
||||||
|
subTitleLabel.sizeToFit()
|
||||||
} else {
|
} else {
|
||||||
subTitleLabel.reset()
|
subTitleLabel.reset()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user