Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9239895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:05:45+00:00 2026-06-18T08:05:45+00:00

I have a multiline UILabel in a UITableViewCell. I want to control the spacing

  • 0

I have a multiline UILabel in a UITableViewCell. I want to control the spacing between the lines, to compress the lines a bit closer together. I’ve read that the only way to control that “leading” is with Attributed Strings. So I’ve done this by making the label attributed instead of plain text, and then I set the lineHeightMultiple to 0.7 to compress the lines:

NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineHeightMultiple = 0.7;
paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
paragraphStyle.alignment = NSTextAlignmentLeft;

NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"HelveticaNeue-Bold" size:15.0], NSFontAttributeName, paragraphStyle, NSParagraphStyleAttributeName, nil];

NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:@"Here is some long text that will wrap to two lines." attributes:attrs];

[cell.textLabel setAttributedText:attributedText];

The problem is, now the overall label is not centered vertically within the UITableViewCell.

How can I fix this? In the attachment below, you can see what I mean. The “compressed” multiline UILabel is higher up in each row than it should be, and doesn’t vertically align with the arrow indicator on the right side any more.

example

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:05:46+00:00Added an answer on June 18, 2026 at 8:05 am

    Line height multiple changes the line hight of all lines, including the first line, so it all rides a little high in your label. What you really want is to adjust the line spacing, so the second line’s starting base line is a little closer than the default.

    Try replacing:

    paragraphStyle.lineHeightMultiple = 0.7;
    

    with:

    paragraphStyle.lineSpacing = -5.0;
    

    Adjust the line spacing value to taste.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have a multiline UILabel that auto-resizes the UIFont size so
I have a Multiline Textbox . I donot want to let user type HTML
I have a multiline textbox that by default, is set to ReadOnly. I would
In my iPhone app, I have a multiline label that I would like to
I want to have a multiline textbox of max of 3 rows and I
In C# I have a multiline TextBox that users enter case notes into. However,
I have a multiline textbox that contains very long text in it. How can
I have a multiline Textbox that can accept HTML Tags. But links are not
I'm unable to find that function. Basically I have a multiline text box and
I have a multiline UILabel whose font size I'd like to adjust depending on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.