How do I vertically align text within a label?
-
When creating a label with the frame attribute set, how can the vertical alignment of text be set within the height of the label? I want the text top aligned not center which appears to be the default.
Thanks!
-
There is no way to change the vertical alignment of a
ui.Label
, but you could achieve a similar effect usingmy_label.size_to_fit()
.
-
@offtheradar , you could also add your label as a subview of another view. Depending on want you are trying to achieve, could give you more control. It sounds a little over the top, but I dont think it is. Just a though
-
last edited by