2

On an apple watch, how do I align two labels at baseline with different font sizes?

look at the red and blue labels, they are not aligned at baseline.

align at baseline align at baseline

This is the structure of the first image in the interface builder:

horizontal group
    label with big font and Baseline=Align Baseline; Alignment vertical=Center
    label with small font and Baseline=Align Baseline; Alignment vertical=Center

This is the structure of the second image in the interface builder:

horizontal group
    label with big font and Baseline=Align Baseline; Alignment vertical=Bottom
    label with small font and Baseline=Align Baseline; Alignment vertical=Bottom

in the first image, the label with the small font is way too high, in the second image, the label with the small font is a little too low.

How can I make them align exactly at the base line?

Gerd Castan
  • 6,275
  • 3
  • 44
  • 89

1 Answers1

-1

If you're using interface builder, just ctrl + drag from one label to the other and select 'Baseline' to set an align baseline constraint.

tc333
  • 89
  • 1
  • 7
  • This does not work in watchOS. The way layout is done is different on watchOS than on iOS, and there is no Autolayout, as this answer seems to assume. – lucius Aug 29 '19 at 12:34