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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:09:01+00:00 2026-05-28T07:09:01+00:00

I am trying to add a UILabel anagrammatically like below – (void)viewDidLoad { [super

  • 0

I am trying to add a UILabel anagrammatically like below

- (void)viewDidLoad 
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg"]]];

    [self loadAndDrawButtons];
    CGRect  frame       =   CGRectMake(357, 240, 48, 42);
    CGRect  frame       =   CGRectMake(357, 200, 48, 42);
    UILabel *myLabel    =   [[UILabel alloc] initWithFrame:frame];

    [myLabel setText:@"THIS"];
    [myLabel setBackgroundColor:[UIColor clearColor]];

    [myLabel setTextColor:[UIColor redColor]];

    [myLabel setShadowOffset:CGSizeMake(1, 1)];

    [myLabel setShadowColor:[UIColor darkGrayColor]];

    [self.view  addSubview:myLabel];
}

So first I set the background for view and then I also display some button on the view. Background and button are successfully loaded. Eventually, I am adding a UILabel to view and I end up with nothing….
I am thinking that the background and my button will hide my UILabel( I know this is not right way but also give it a try) so that I comment out

// [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@”bg”]]];

// [self loadAndDrawButtons];

Now my view is blank without my UILable…
Could any one give my a hint about this problem…Thanks a lot

  • 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-28T07:09:01+00:00Added an answer on May 28, 2026 at 7:09 am

    The problem likes in the label frame:

    CGRect frame = CGRectMake(357, 200, 48, 42);
    

    which is relative to its superview coordinates in this case your view is at the most 320 x 480 (or at least thats how much the screen can show without scrolling) however you are providing a an x value of 357 (greater than 320), which means the label is not being drawn within the visible portion of the view.

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

Sidebar

Related Questions

I'm trying add a tab to my web page that looks like this: Using
I'm trying to add an extra UILabel into each cell( UITableView ) I'v succeeded
I'm trying add some implicit rules in CMake that will generate direct dependencies (like
hi i am trying to add uilabel in a group table .The approach i
I am trying to add a gradient layet to my UILabel for some reasons
I have subclassed UILabel to provide a copy menu and would like to add
I am trying to add/remove UILabels to a ScrollView. The adding takes place just
Trying to add an onclick handler to my tabs, and can't seem to get
trying to add an ExpiresDefault ExpiresByType to content on my website so that way
Trying to add a 'box' to a form at design time, I looked up

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.