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 8725271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:00:23+00:00 2026-06-13T08:00:23+00:00

I am new to iPhone, How do I vertically align my text in the

  • 0

I am new to iPhone,

How do I vertically align my text in the UILabel?

Here is my Code snippet,

    UILabel *lbl=[[UILabel alloc]init];
    lbl.frame=CGRectMake(10,10,100,100);
    lbl.backgroundColor=[UIColor clearColor];
    lbl.font=[UIFont systemFontOfSize:13];
    lbl.text=@"123456";
    [scrollVw addSubview:lbl];

text displayed is in the format of 123456 but i want text should be display vertically like,

6
5
4
3
2
1

Any help will be appriciated.

  • 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-13T08:00:24+00:00Added an answer on June 13, 2026 at 8:00 am

    Its impossible to align the text in UILabel vertically. But, you can dynamically change the height of the label using sizeWithFont: method of NSString, and just set its x and y as you want.

    As an alternative you can use UITextField. It supports the contentVerticalAlignment peoperty as it is a subclass of UIControl. You have to set its userInteractionEnabled to NO to prevent user from typing text on it.

    EDIT 1

    Well instead of a UILabel , Make a UITableView like :-

    TableActivityLevel=[[UITableView alloc] initWithFrame:CGRectMake(224, 203, 27, 0) style:UITableViewStylePlain];
    TableActivityLevel.delegate=self;
    TableActivityLevel.dataSource=self;
    TableActivityLevel.autoresizingMask = UIViewAutoresizingFlexibleHeight; 
    TableActivityLevel.rowHeight = 17;
    TableActivityLevel.backgroundColor=[UIColor clearColor];    
    TableActivityLevel.layer.borderColor = [[UIColor clearColor]CGColor];
    TableActivityLevel.separatorStyle = UITableViewCellSeparatorStyleNone;
    

    EDIT 2 Found the method using UILabels too !! 🙂 Check this out….

    UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(0.0, 0.0, 10.0, 100.0)];
    [label1 setBackgroundColor:[UIColor clearColor]];
    [label1 setNumberOfLines:0];
    [label1 setCenter:self.view.center];
    [label1 setFont:[UIFont fontWithName:@"Helvetica" size:12.0]];
    [label1 setTextColor:[UIColor whiteColor]];
    [label1 setTextAlignment:UITextAlignmentCenter];
    [label1 setText:@"1 2 3 4 5 6"];
    [self.view addSubview:label1];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

fairly new iPhone developer here. Building an app to send RS232 commands to a
I am new iPhone developer, Can anybody suggest me what should i do here:
I'm developing a new iPhone application, Here i have parsed a 'csv' file from
The new iPhone 3GS has support for voice commands, stuff like call Bill or
I’m writing a new iPhone app which doesn’t depend on any of the 3.0
I'm testing a new iPhone app with my end-users and found that a lot
I have a new iPhone app that has the following (and only the following)
I'm implementing a new iPhone app and am relatively new to Cocoa development overall.
I've started a new iPhone app that needs to remember a single, 40-char string.
I am a new iPhone developer and totally new to web-services as well. I

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.