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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:42:18+00:00 2026-05-26T06:42:18+00:00

Suppose i want to allocate some space on the screen for a few rectangles,

  • 0

Suppose i want to allocate some space on the screen for a few rectangles, each responsible for holding some data. I am thinking it’ll be a TableView with 3 rows

What would be the object representing the outer shape, the box table will sit in?

/-----------\
| some txt  |
| more txt  |
| other txt |
\-----------/

/-----------\
| some txt  |
| more txt  |
| other txt |
\-----------/

I suppose i could make it a unclickable UIButton, but putting UITableView inside seems awkward.

How is it done in Stocks application? There is a section on top and a section towards the bottom.

  • 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-26T06:42:19+00:00Added an answer on May 26, 2026 at 6:42 am

    You have different headers per tableView: one for the tableView, and you can have one for each section

    Green ist the tableViewHeader, while blue shows sectionHeaders.

    enter image description here

    -(void) viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
        if (headerView == nil) {
            [[NSBundle mainBundle] loadNibNamed:@"DetailContactHeader" owner:self options:nil];
            headerView.nameLabel.text = [NSString stringWithFormat:@"%@ %@", 
                                                       [contact objectForKey:@"name"],
                                                       [contact objectForKey:@"familyname"]];
            if ([[contact allKeys] containsObject:@"pictureurl"]) {
                headerView.avatarView.image = [UIImage imageNamed:[contact objectForKey:@"pictureurl"]];
            }
        }
        [self.tableView setTableHeaderView: headerView];
    }
    
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
        return 2;
    }
    
    - (NSInteger)tableView:(UITableView *)tableView 
     numberOfRowsInSection:(NSInteger)section {
        // Return the number of rows in the section.
        return [[contact allKeys] count]-3;
    }
    
    
    // Customize the appearance of table view cells.
    - (UITableViewCell *)tableView:(UITableView *)tableView       
             cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
        static NSString *CellIdentifier = @"Cell";
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
    
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 
                                           reuseIdentifier:CellIdentifier] autorelease];
        }
    
        id key = [self.possibleFields objectAtIndex:indexPath.row];
        cell.textLabel.text = [NSString stringWithFormat:@"%@", key];
        cell.detailTextLabel.text = [NSString stringWithFormat:@"%@", [contact objectForKey:key]];
        return cell;
    }
    
    -(CGFloat) tableView:(UITableView *)tableView 
      heightForHeaderInSection:(NSInteger)section
    {
        return 44.0;
    }
    
    -(UIView *) tableView:(UITableView *)tableView 
    viewForHeaderInSection:(NSInteger)section
    {
        UILabel *l = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 44)] autorelease];
        l.backgroundColor = [UIColor clearColor];
        l.text= @"I am a Section Header";
        return l;
    }
    

    You will find the code for this App here: MyContacts

    For any …header… method there is a corresponding …footer… method.

    How it is done in the Stock app, I just can guess: I think somehow similar.

    To judge if this is the right solution for you, you don’t give enough informations. But I think so.

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

Sidebar

Related Questions

If using COleDataSource & COleDataObject, you allocate some global memory for each clipboard data
Suppose I want to store N samples (each sample takes up a significant portion
Suppose I want to write an application that is targeting some JRE version (e.g.
Suppose I want to override some class which is already defined somewhere, for example,
Suppose I want to create a functor that acts upon some general type. For
Suppose I want to add two buffers and store the result. Both buffers are
Suppose I want to have a blog with Rails 3 on my website and
Suppose I want to put objects that identify a server into a stl set
Suppose I want to execute code, for example value += 5 inside a namespace
Suppose I want to make a Web application which uses a fixed width and

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.