0

My question is related to solving a problem and also to improve my understanding of swift.

I have a UILabel and a TextView. I have the same size font in both. However, in the TextView I am using attributed strings. The fonts appear the same but the line spacing is greater in the label. My problem is I cannot find a way to change the line spacing in the Label other than switching to Attributed String for the Label or for that matter even determining what the present spacing is.

Q1: Is there no other way to control the label spacing other than Attributed Strings?

Q2: Because of issues like this, should I be thinking that Attributed Strings might be a "best practice" regardless -- to give more control?

3
  • Q1: Exactly - you should use attributed strings if you want to fine-tune things like line spacing. Q2: No. If you don't need special formatting, use regular text, as it consumes less power. If you have lots of labels, a little goes a long way. Commented Apr 13, 2018 at 16:13
  • Possible duplicate of How to control the line spacing in UILabel Commented Apr 13, 2018 at 16:13
  • Thank you. The comment about consuming less power helps me understand why to use the UILabel if possible. Commented Apr 13, 2018 at 19:01

1 Answer 1

1

You can set linespacing in Label Attribute inspector. See screenshot.enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.