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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:20:05+00:00 2026-06-10T01:20:05+00:00

can anyone tell me how to add two labels for a view that i

  • 0

can anyone tell me how to add two labels for a view that i was added on UITableView Cell.i have created that view as UIView with some name.and i have created two labels in UIView class and also set frame for labels,set text and etc.my problem is am getting that view in tableview cell but not those labels.

    countLabel.text = @"4";
    countLabel.frame=CGRectMake(275, 10, 20, 15);
    countLabel.font=[UIFont boldSystemFontOfSize:15.0];
    countLabel.textColor=[UIColor colorWithWhite:0.0 alpha:0.5];
    countLabel.backgroundColor=[UIColor clearColor];

    hrsLabel.text = @"Hours";
    hrsLabel.frame=CGRectMake(260, 30, 45, 15);
    hrsLabel.font=[UIFont boldSystemFontOfSize:15.0];
    hrsLabel.textColor=[UIColor colorWithWhite:0.0 alpha:0.5];
    hrsLabel.backgroundColor=[UIColor clearColor];

this is just i am setting frame,text to labels like that in a UIView.and

GreenView *greenView = [[GreenView alloc] initWithFrame:CGRectMake(250, 8, 60, 50)];
greenView.backgroundColor = [UIColor colorWithRed:0.000 green:0.690 blue:0.313 alpha:0.5];
[cell.contentView addSubview:greenView];

and here i am adding that UIView to a tableview cell.and i dont know how to add those labels to my UIView. please help me.

sorry if any mistakes in english.
anyone please help me.
thanks alot 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-10T01:20:07+00:00Added an answer on June 10, 2026 at 1:20 am

    Add the labels to GreeView like this,

    Eg:

        GreenView *greenView = [[GreenView alloc] initWithFrame:CGRectMake(250, 8, 60, 50)];
        greenView.backgroundColor = [UIColor colorWithRed:0.000 green:0.690 blue:0.313 alpha:0.5];
    
        countLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 20, 15)];
        countLabel.text = @"4"; 
        countLabel.font=[UIFont boldSystemFontOfSize:15.0]; 
        countLabel.textColor=[UIColor whiteColor];
        countLabel.backgroundColor=[UIColor clearColor]; 
        [greenView addSubview:countLabel];
    
        hrsLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 40, 45, 15)];
        hrsLabel.text = @"Hours";
        hrsLabel.font=[UIFont boldSystemFontOfSize:15.0]; 
        hrsLabel.textColor=[UIColor whiteColor]; 
        hrsLabel.backgroundColor=[UIColor clearColor];
        [greenView addSubview:hrsLabel];
    
        [cell.contentView addSubview:greenView];
    

    Hope this will help you.

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

Sidebar

Related Questions

Can anyone tell me how can I add an image over another image without
can anyone tell me how can I (programatically) add the current/selected user to a
can anyone tell me why this does not work Excel.Worksheet ws_res = (Excel.Worksheet) wb.Worksheets.Add(mis,
Im a VB.NET beginnger, can anyone tell me how I can dynamically add a
Can anyone please tell me how to add a C++ file in to an
Can anyone please tell me how to make an interface like that which is
Can anyone tell me how to add a Windows string resource? How to read
Can anyone tell me How to add Bookmarks to the Report generated in PDF
I wonder if anyone can advise? I have a JSP which contains two forms,
Possible Duplicate: How to add two numbers of any length in java? can anyone

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.