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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:04:22+00:00 2026-05-11T20:04:22+00:00

My UITableViewCells take up the full viewing area. I’d like to use a grouped

  • 0

My UITableViewCells take up the full viewing area. I’d like to use a grouped table so the cells appear to have rounded corners. Right now, if I set the number of sections to something greater than one, I get the number of sections in grouped style but all the cells repeat in each section. How do I setup the table so each cell is in a section?

Also, is it possible to programmatically set the table style to grouped?

  • 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-11T20:04:22+00:00Added an answer on May 11, 2026 at 8:04 pm

    For your second question:

    tableView.style = UITableViewStyleGrouped;
    

    Or, if you’re creating it programmatically:

    tableView = [[UITableView alloc] initWithFrame:frame style:UITableViewStyleGrouped];
    

    For your first question, I assume you are setting up your cells something like this:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        ...
        setupCell(cell,indexPath.row);
        return cell;
    }
    

    Where setupCell is something that checks the index and sets the cell accordingly. The IndexPath, however, tells you which row in which section to set up.

    I also assume that you’re returning the full number of rows in the function

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    

    Where you should only be returning 1, since you want exactly 1 row in each section.

    Then when setting up your cell, you’d want to check the indexPath.section instead of the indexPath.row. Rows are zero-based by section, so the calls to cellForRowAtIndexPath will have index paths that look like this:

    Section Row
    0, 0
    1, 0
    2, 0

    Whereas originally, when you had only one section, it would have been:
    0, 0
    0, 1
    0, 2

    And what you’re seeing right now, since you return the same number of rows as sections is:
    0, 0
    0, 1
    0, 2

    1, 0
    1, 1
    1, 2

    2, 0
    2, 1
    2, 2

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

Sidebar

Related Questions

I've created some custom UITableViewCells in a nib file and would like to use
I have a UITableView of custom UITableViewCells which looks like this: [ CELL 0
I have a UITableView with custom UITableViewCells. The table has two sections, the first
I have a UITableView with custom UITableViewCells in it. These cells can be opened
I am drawing custom UITableViewCells. My cells are opaque and are completely drawn in
I have a few custom UITableViewCells - http://img11.imageshack.us/i/customfacilitiescell.png/ which are added to this UIViewController
Is there a way to add delete controls, like in UITableViewCell, on a table
I have a UITableView of UITableViewCells that so far performed well. I now aded
I am converting over to iOS 5 and storyboards. When I have a table
I have one table view within the app that I hope multiple parts of

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.