Closed kartikthapar closed 6 years ago
One more thing, if I just have a single label aligned using Alignment.center
, it show up as above. It feels like the width of this containing view is wrong but there is nothing much that is going on.
Just from looking at the code, without testing it myself, it looks like the thing missing in your original post is giving a width/height when making your arrangement.
Layout().arrangement().makeViews(in: view)
should be
Layout().arrangement(width: view.width, height: view.height).makeViews(in: view)
Without passing the sizing information, LayoutKit is going to calculate the frame at the largest size.
Check out Layout.swift
, method starting at line 121 arrangement(origin:width:height:)
Edit: Same thing for your second post about the single line label.
@kartikthapar just out of interest, what font are you using in these examples?
The answer by @tysonkerridge appears to be correct. Closing the issue.
Here's a wrapper for a bunch of components/layouts but currently only hosting a label layout.
Its called here:
Here's the result:
Now I am unsure what's wrong here: