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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:35:42+00:00 2026-05-20T11:35:42+00:00

ok here’s the thing, it’s been two days now trying to build a decent

  • 0

ok here’s the thing, it’s been two days now trying to build a decent tableview cell with subtitles style.

so i overrided the ‘tableview:heightforrowatindex:’ method. fine
i also put the numberoflines for the details to 0.

this works fine in ios4.0

but for ios 3.0 it doesn’t
it appears that the textlabel and the detailtextlabel are having certain margins at the top which pushes all the cell content downwards to overlap the cell below.
This is crazy behaviour. and i couldn’t find a way to set the textlabel/detailtextlabel location inside its content view.

Please help.
Resizing UITableViewCells in iOS4 versus iOS3 This guy said he’s going to implement his own controls. but that’s too much work, and it’s hard for me.
There must be a way that someone already knew to bypass this problem.
thanks

  • 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-20T11:35:43+00:00Added an answer on May 20, 2026 at 11:35 am

    actually it seems that the people at apple didn’t really make the uitableviewcell as customizable as would a normal developer hope.

    so you would have to customize it by yourself.
    and sinsce i didn’t have time to override UITableViewCell and implement my custom one.

    I have done it hastingly. through

    UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:@"cell"];
    
    if( nil == cell ) {     
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"] autorelease];
    
        //contentview
        UIImageView * imageView = [[UIImageView alloc]initWithFrame:CGRectMake(1, 5, 11, 9)];
        imageView.image=_headerImage;
    
        UILabel* textLabel=[UILabel new];
            UILabel* detailTextLabel=[UILabel new];
    
    //get and set the size of the labels here 
    
            textLabel.font=_font;
        detailTextLabel.font=_fontD;
        textLabel.numberOfLines=0;
        detailTextLabel.numberOfLines=0;
    
        textLabel.backgroundColor=[UIColor clearColor];
        detailTextLabel.backgroundColor=[UIColor clearColor];
    
        textLabel.tag=202;
        detailTextLabel.tag=203;
        imageView.tag = 204;
    
        [cell.contentView addSubview:imageView];
        [cell.contentView addSubview:textLabel];
        [cell.contentView addSubview:detailTextLabel];
        [textLabel release];
        [detailTextLabel release];
        [imageView release];
    }
    

    of course while implementing

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {   
        if(!_cellTitleSizes)
        {
            _cellTitleSizes= [NSMutableArray new];
            _cellDetailSizes= [NSMutableArray new];
        }
    
        MenuItem *tempItem =[self GetItemFromIndexPath:indexPath];
    
        CGSize size = [ tempItem.title sizeWithFont:_font constrainedToSize:_textSize lineBreakMode:UILineBreakModeWordWrap];
        CGSize size2 = [[MenuListViewController GetDetailsToDisplay:tempItem] sizeWithFont:_fontD constrainedToSize:_textSize lineBreakMode:UILineBreakModeWordWrap];
    
        //the following information will be used to set the title and description labels in the cell.
        [_cellTitleSizes addObject:[NSValue valueWithCGSize:size]];
        [_cellDetailSizes addObject:[NSValue valueWithCGSize:size2]];   
    
        return MAX( (size.height+size2.height)+ 30, 44.0f );
    }
    

    good luck to all of you

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

Sidebar

Related Questions

Here is the problem that I am trying to solve. I have two folders
Here is the code in a function I'm trying to revise. This example works
I have a jquery bug and I've been looking for hours now, I can't
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is the css: #content ul { font-size: 12px; } I am trying this:
Here is my problem.. I have the option to create(add) two new input fields,
Here's the two scenarios. We are using a manually built xml soap request with
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Here is my code, which takes two version identifiers in the form 1, 5,
Here's a coding problem for those that like this kind of thing. Let's see

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.