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
Hello,
I have two label inside HStack and i want to make them fill equally (each label = 50% width of content)
How can i do that ? I tried align(.fill) but didn't work
The text was updated successfully, but these errors were encountered:
By default HStack(or VStack) only supports items with intrinsic content size or fixed size. With one exception, align(.fill), which will stretch the cross axis to match the size of Stack (aka. vertical axis for HStack, horizontal axis for VStack).
If you want a proportional size for your items on main axis, you have to combine with constraints.
view1.makeCons { $0.width.equal(view2).multiply(0.3) }
In your case, simply use:
label1.makeCons { $0.width.equal(label2) }
Hello,
I have two label inside HStack and i want to make them fill equally (each label = 50% width of content)
How can i do that ? I tried align(.fill) but didn't work
The text was updated successfully, but these errors were encountered: