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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:53:40+00:00 2026-06-04T03:53:40+00:00

Any idea how to move the UITableViewCell text over so that it doesn’t overlap

  • 0

Any idea how to move the UITableViewCell text over so that it doesn’t overlap the small image on the left hand side?

here’s a screenshot:

enter image description here

thanks for any help

here’s my TableCell code:

- (UITableViewCell *)tableView:(UITableView *)tableView1 cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 
    UILabel* nameLb;
    UILabel* detailsLb; 

    UITableViewCell *cell = [tableView1 dequeueReusableCellWithIdentifier:@"log-cell"]; 
    if (cell == nil){
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"log-cell"] autorelease];        

        UIImage* img = [ImgUtil image:[NSString stringWithFormat:@"butList3_%d.png", [[SelectCategory instance] select] + 1 ]];
        UIImageView* bgImage = [[[UIImageView alloc] initWithImage:img ]autorelease];
        [cell addSubview:bgImage ];
        [cell sendSubviewToBack:bgImage ];


        nameLb = [[[UILabel alloc] initWithFrame:CGRectMake(5, 5, 250, 40)] autorelease];
        [nameLb setNumberOfLines:4];
        [nameLb setBackgroundColor:[UIColor clearColor]];
        [nameLb setTextColor:[UIColor whiteColor]];
        [nameLb setTag:NAME_TEXT];
        [nameLb setFont:[UIFont fontWithName:@"Helvetica-Bold" size:15]];
        [nameLb setMinimumFontSize:10];

        [cell addSubview:nameLb];

        //add UIImage
        cell.imageView.image = [UIImage imageNamed:@"shop.png"];

        detailsLb = [[[UILabel alloc] initWithFrame:CGRectMake(5, 45, 250, 20)] autorelease];
        [detailsLb setBackgroundColor:[UIColor clearColor]];
        [detailsLb setTextColor:[UIColor whiteColor]];
        [detailsLb setTag:DETAILS_TEXT];
        [detailsLb setFont:[UIFont fontWithName:@"Helvetica" size:12]];
        [cell addSubview:detailsLb];


    }else {

        nameLb = (UILabel*)[cell viewWithTag:NAME_TEXT];
        detailsLb = (UILabel*)[cell viewWithTag:DETAILS_TEXT];

    }


    ObjectInfo* obj = [myList objectAtIndex:indexPath.row ] ;
    nameLb.text = [obj name];
//    cell.textLabel.textColor = [UIColor whiteColor];
//    cell.textLabel.font = [UIFont boldSystemFontOfSize:17];

    double distance = [ProjUtil getDistanceWithLat1:currentLocation.latitude long1:currentLocation.longitude lat2:obj.location.latitude long2:obj.location.longitude];
    detailsLb.text = [NSString stringWithFormat:@"%.2f miles", [ProjUtil kmToMi:distance]];
//    cell.detailTextLabel.textColor = [UIColor whiteColor];
//    cell.detailTextLabel.font = [UIFont systemFontOfSize:15];

    [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    [cell setBackgroundColor:[UIColor clearColor]];

    ///[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
    return cell;
} 
  • 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-04T03:53:42+00:00Added an answer on June 4, 2026 at 3:53 am

    When you create the label you are positioning them with this line:

    detailsLb = [[[UILabel alloc] initWithFrame:CGRectMake(5, 45, 250, 20)] autorelease];
    

    This sets the frame of your label. CGRectMake is a function that gives you a CGRect, in this case with origin (5,45), width 250 and height 20.

    If you want to move the labels over to the right, increase the x value of your frame (the 5 in the CGRectMake call above).

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

Sidebar

Related Questions

Any idea why the small image that I move across the screen gets blurry?
Any idea why sendSynchronousRequest is causing a leak below? Instruments states that the responsible
When I move out of my input field the blur function doesn't fire. Any
I understand why it does that but I don't really have any idea of
Any idea why this code: extern C __declspec(dllexport) void Transform(double x[], double y[], int
Any idea how to join multiple tables in ssis programatically using Merge Join ?
Any idea about ORA-1555: snapshot too old: rollback segment number I am getting this
Any idea why this wont print the errors? // Validate the email if (preg_match($regex,
Any idea why the following code is not working mysql credentials are correct, have
Any idea how to go about formatting the data so I can export from

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.