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

  • Home
  • SEARCH
  • 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 7936725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:18:04+00:00 2026-06-03T22:18:04+00:00

I have a UITableView controller, UITableView xib, and two UITableViewCell subclasses with there xib’s.

  • 0

I have a UITableView controller, UITableView xib, and two UITableViewCell subclasses with there xib’s. I dragged out an individual cell for each xib. My first cell’s height is 115 and my other cell has the default height. When cellForRowAtIndexPath is called in my controller I have a conditional statement that sets the first row to my bigger cell. Every row after that is set to my other cell. Even thought the bigger cells are being rendered, the default cells are not recognizing the fact that the first cell is bigger than the default, and therefor the default cells are overlapping the bigger cell. I set a distanceLabel outlet at the bottom of my bigger cell to show you what I mean:

enter image description here

Note: The 2.3 miles is part of the first cell.

- (void)viewDidLoad
{
    [super viewDidLoad];

    // load the cell nib
    UINib *nib = [UINib nibWithNibName:@"CustomViewCell" bundle:nil];
    UINib *bigNib = [UINib nibWithNibName:@"BigCell" bundle:nil];

    //Register the nib
    [[self tableView] registerNib:nib forCellReuseIdentifier:@"CustomViewCell"];
    [[self tableView] registerNib:bigNib forCellReuseIdentifier:@"BigCell"];
}
- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
        if (indexPath.row == 0) {
        BigCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BigCell"];
        NSString *title = [self.frontList objectAtIndex:indexPath.row];
        [[cell nameLabel] setText:title];
        [[cell distanceLabel] setText:@"2.3 miles"];
        return cell;
    } else {

        CustomFrontCell *cell  = [tableView dequeueReusableCellWithIdentifier:@"CustomViewCell"];
        NSString *titles = [self.frontList objectAtIndex:indexPath.row];
        [[cell nameLabel] setText:titles];
        return cell;
    }
}

How can I make these cells render with the correct spacing and height?

  • 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-03T22:18:05+00:00Added an answer on June 3, 2026 at 10:18 pm

    You can use UITableViewDelegate method tableView:(UITableView *)tableView heightForRowAtIndexPath: to control height.

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

Sidebar

Related Questions

I have a UITableViewController and UITableViewCell . This cell contains three text fields. Each
I have an UITableview controller without an XIB. I set the background colour of
I have a .xib with a controller, a UITableViewController . It contains a UITableView
Hey - I have the following method on my UITableView controller public void RemoveEventFromList(Event
I have a working UITableView in my view controller. It is being successfully populated
I have created a static table cell in a .xib, however when it is
I have a UITableView in a controller that is nested under a UITabBar .
I have a view controller where I programmatically add the UITableView. However, I would
I have UItableview where every cell containing 5 cell and these cell are representing
I can't figure out what am I doing wrong here, I have there are

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.