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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:19:30+00:00 2026-06-04T01:19:30+00:00

I have some weird behavior on the iPad that I am not getting on

  • 0

I have some weird behavior on the iPad that I am not getting on the iPhone.

I have a Grouped table view that has sections and headers for the sections, the problem is that on the iPad the top most section’s header is not displayed, when scrolling down the table the sections header appears for a short while just before going of screen.

Before scrolling

http://desmond.imageshack.us/Himg525/scaled.php?server=525&filename=screenshot2012051410074.png&res=landing http://desmond.imageshack.us/Himg525/scaled.php?server=525&filename=screenshot2012051410074.png&res=landing

After scrolling

http://desmond.imageshack.us/Himg59/scaled.php?server=59&filename=screenshot2012051410074.png&res=landing http://desmond.imageshack.us/Himg59/scaled.php?server=59&filename=screenshot2012051410074.png&res=landing

The code for creating the headers of the sections:

- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 
{
    NSString *sectionTitle = [self tableView:tableView titleForHeaderInSection:section];
    if (sectionTitle == nil || [sectionTitle isEqualToString:@""]) {
        return nil;
    }

    // Create label with section title
    UILabel *label = [[UILabel alloc] init] ;
    label.frame = CGRectMake(12, 0, 300, 30);
    label.backgroundColor = [UIColor clearColor];
    label.textColor = [UIColor blackColor];
    label.shadowColor = [UIColor whiteColor];
    label.shadowOffset = CGSizeMake(0.0, 1.0);
    label.font = [UIFont boldSystemFontOfSize:16];
    label.text = sectionTitle;

    UIImage *img = [UIImage imageNamed:@"header"];
    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 0, 300, 44)];
    imgView.image = img;

    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 44)];

    [view addSubview:imgView];
    [view addSubview:label];

    return view;
}

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    int aSection = [[self.sectionsToDisplay objectAtIndex:section] integerValue];
    return [self.groupHeadings objectAtIndex:aSection];
}

My TableView’s code:

tableViewResult = [[UITableView alloc] initWithFrame:mainView.frame style:UITableViewStyleGrouped];

tableViewResult.separatorColor = [UIColor clearColor];
[mainView addSubview:tableViewResult];

I set the delegate and datasource in another method as I first do a web request before loading any data into the table, ie when the web request is done I do:

tableViewResult.delegate = self;
tableViewResult.dataSource = self;
[tableViewResult reloadData];

Everything works as expected except for the header of the top most section, and only on the iPad.

Any ideas what can cause this behavior?

  • 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-04T01:19:32+00:00Added an answer on June 4, 2026 at 1:19 am

    What fixed the issue was changing this function to:

    -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
    {
        int aSection = [[self.sectionsToDisplay objectAtIndex:section] integerValue];
        if([[self.groupHeadings objectAtIndex:aSection] isEqualToString:@""])
            return nil;
        return [self.groupHeadings objectAtIndex:aSection];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting some weird behavior in asp.net MVC2 (at least it's not what I'm
I have some extremely weird behavior that seems to result in silent exceptions. How
I have a list of links that are exhibiting some really weird behavior. The
I have a weird issue. I have some icons that are being built based
I have some input elements that the users are request special behavior on pageup
Alright, I have some weird behavior and this question goes to the people out
I just had some weird behavior from a version of g++ for Windows that
I'm experiencing some weird behavior with SELECT statements in sqlite. There is one table
I am experiencing some weird behavior with an android app I have been working
I have InApp purchasing setup in my app. I am having some weird behavior

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.