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

A UILabel's text is drawn in a CGRect(x,y,size,width). The label can have multiple lines
I have a label like <label for=Some Feild >Some Text </label> Now I want
I have a form input , and the label spans multiple lines, and I
I have this label control in my web page <asp:Label ID=Label1 runat=server Text=test></asp:Label> And
I have the normal PayPal donation button. I want to add two multiple choice
I have a UILabel with some text, say Hello World abcdefg The label can
I have a RoundedRectView with a UILabel that holds lines of text of varying
I have a table view with multiple sections. I want to display different section
I want to display a two column layout in swing, a text label on
so I have a form that I have multiple input text fields as well

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.