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

  • SEARCH
  • Home
  • 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 6030863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:06:01+00:00 2026-05-23T05:06:01+00:00

I have a label with multiple lines .I want the text on the label

  • 0

I have a label with multiple lines .I want the text on the label always starts from top left corner independent of the height and number of lines of label.

Right now i am using a property

[question1Label setContentMode: UIViewContentModeTopLeft];

But its not working

Thanks

  • 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-05-23T05:06:01+00:00Added an answer on May 23, 2026 at 5:06 am

    I’ve noticed that contentMode property of UILabel doesn’t affect its text’s alignment. Use the textAlignment property.

    label.textAlignment = UITextAlignmentLeft; 
    

    Edit: This will align the text Center-Left. In order to show the text from Top-Left you need to find the height of the text using sizeWithFont: method of NSString. See this SO post to know how to do it.

    As an alternative you can use UITextField, the subclass of UIControl, which inherits UIControl’s the contentVerticalAlignment property.

    textField.contentVerticalAlignment = UIControlContentVerticalAlignmentTop;
    

    You can use this property to align the text on top. You can disable the user from editing the text by using the property userInteractionEnabled property.

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

Sidebar

Related Questions

I have a long label that spans multiple lines and I can not get
I have a user control that contains multiple controls (CheckBox, Button, Label...). I want
i have a label tag and i want to remove text between <label> </label>
I have a form input , and the label spans multiple lines, and I
I have a label which would display strings from 0 ft to say 999
I have a label which labels the line numbers based on the text on
I have a label in my form. I want this label to dynamically change
I have a label and this code: string User = Environment.UserName; toolStripStatusLabel1.Text = This
I have a UILabel with some text, say Hello World abcdefg The label can
I have a white label/multi-tennant server providing the same services, but branded for multiple

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.