1
votes

I have a horizontal stack view with 3 labels on it. Second label ("Separator Label" in the image) just has a 'dot' as the text, but since the label is within stack view, it takes the height of the stack view and other labels. I want the dot to be in center, but it sits at the bottom. I tried changing base alignment to center and view's content mode to center, but it still remains at the bottom.

How can I make the text / dot move to the center? All I want is the dot vertically centered.

Below are the images - first image is the stack view and labels in File View, second image is contents of stack view and 3rd image is settings on the separator label.

enter image description here

enter image description here

enter image description here

2
Unicode Character “•” (U+2022) would help?Luca Iaco

2 Answers

0
votes

If you want it centered vertically, you probably need to replace the label with an image. When you use text, the character space is centered the way you want but the font defines the period as being at the bottom of that space.

0
votes

You could use a normal UIView instead of the UIStackView and add the subviews and constraint the "." period UILabel to the centerX and it'll stay at the center forever irrespective of the other contents of the super view.