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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:58:50+00:00 2026-06-07T03:58:50+00:00

I am new to iphone.i found UILabel instance methodes very hard for me to

  • 0

I am new to iphone.i found UILabel instance methodes very hard for me to implement.how can i use it.how can i customize the appearance of your text of a UIlabel further by subclassing UILabel.Plz i need little help to initiate.Foe example i have a label in my viewController how can i custmize it’s text and hoe to subclass
.thanks in advance.

  • 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-07T03:58:52+00:00Added an answer on June 7, 2026 at 3:58 am

    You can use so many properties of a UILabel like:

    UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 100, 40)];
    lbl.font = [UIFont fontWithName:@"Helvetica" size:12.0];    // For setting font style with size
    lbl.textColor = [UIColor whiteColor];        //For setting text color
    lbl.backgroundColor = [UIColor clearColor];  // For setting background color
    lbl.textAlignment = UITextAlignmentCenter;   // For setting the horizontal text alignment
    lbl.numberOfLines = 2;                       // For setting allowed number of lines in a label
    lbl.lineBreakMode = UILineBreakModeWordWrap; // For setting line break mode
    lbl.text = @"TitleText";                            // For setting the text inside the label
    

    Let me know if any thing other than this you want to know!!

    The two methods

    - (CGRect)textRectForBounds:(CGRect)bounds limitedToNumberOfLines:(NSInteger)numberOfLines
    {
        return CGRectInset(bounds, MARGIN, MARGIN);
    }
    
    - (void)drawTextInRect:(CGRect)rect
    {
        [super drawTextInRect: CGRectInset(self.bounds, MARGIN, MARGIN)];
    }
    

    We are using CGRectInset to create a rectangle that is either larger or smaller than an existing rectangle (bounds).

    For Smaller rectangle, use positive values as MARGIN
    For Larger rectangle, use positive values as MARGIN

    All the best!!!

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

Sidebar

Related Questions

New to iPhone 3.2, Apple introduced File-Sharing support. Details can be found at https://developer.apple.com/iphone/library/releasenotes/General/WhatsNewIniPhoneOS/Articles/iPhoneOS3_2.html#//apple_ref/doc/uid/TP40009337-SW1
Hi im new to iphone development by searching i found that iphone development can
I'm testing a new iPhone app with my end-users and found that a lot
I am very new for iPhone web developer. I started with reading Safari Web
I'm very new to iPhone development so please bear with me. I'm following the
Let me start off by saying Im VERY new to iphone development, but Im
This is my first post on here and I'm very new to iPhone developing,
I'm new to Iphone development, i want to implement a simple application that some
Im relatively new to iPhone development and Im trying to implement Facebook functions in
I am very new to iPhone development, so please be gentle with me. 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.