You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.
I'm trying to setup a layout consisting of two labels placed vertically in StackLayout that has defined height. Labels should adjust it's font size according to available space. However, layouting engine scales only bottom label, preserving size of the top one. Here is demo code taken form an example app, changed to cover this case:
open class MiniProfileLayout: InsetLayout<View> {
public init(name: String, headline: String) {
let nameLayout = LabelLayout(
text: name,
font: UIFont.systemFont(ofSize: 40),
config: { label in
label.adjustsFontSizeToFitWidth = true
label.minimumScaleFactor = 0.5
})
let headlineLayout = LabelLayout(
text: headline,
font: UIFont.systemFont(ofSize: 40),
config: { label in
label.adjustsFontSizeToFitWidth = true
label.minimumScaleFactor = 0.5
}
)
super.init(
insets: UIEdgeInsets.zero,
sublayout: StackLayout(axis: .vertical, spacing: 0, sublayouts: [nameLayout, headlineLayout]),
config: { view in
view.backgroundColor = UIColor.white
}
)
}
}
Fonts are set to 40 points, and entire view has height of 80 - they can't feet intentionally and they need to resize. And instantiating the view:
I'm trying to setup a layout consisting of two labels placed vertically in StackLayout that has defined height. Labels should adjust it's font size according to available space. However, layouting engine scales only bottom label, preserving size of the top one. Here is demo code taken form an example app, changed to cover this case:
Fonts are set to 40 points, and entire view has height of 80 - they can't feet intentionally and they need to resize. And instantiating the view:
And result:
The text was updated successfully, but these errors were encountered: