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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:05:47+00:00 2026-06-07T17:05:47+00:00

I have a grouped UITableView . Now unlike the default table view header my

  • 0

I have a grouped UITableView. Now unlike the default table view header my header should be next to the individual cells:

Standard:

[Header Cell]
[Item 1]
[Item 2]

What I need

+-------+----------------+
|       |  Item 1a       |
|  h1   +----------------+
|       |  Item 1b       |
+ - - - +----------------+
|          Item 1c       |
+------------------------+
|       |  Item 2a       |
|  h2   +----------------+
|       |  Item 2b       |
+------------------------+
|       |  Item 3a       |
|  h3   +----------------+
|       |  -placeholder- |
+-------+----------------+

Some remarks:

  • Group H1 has three items
  • Group H2 has two items
  • Group H3 has just one item (I have to insert a placeholder cell so that the header cell can have the full height of two item-cells
  • When the user scrolls the list then the header should be pushed upwards that the two header-cells don’t overlap.

The challenge here is the height of the header cell:

  • If I set the height to 0 and uncheck clip subviews then that header cell is shown but does not get pushed away at the correct position.
  • If I set the height of the header cell to the visual height then there is an empty space of that height across the whole width of the table which I don’t want…

Update 1: I just realized that apple uses such a list for the search (grouped by messages, mails, contacts, calenders etc.). So my question basically is how can I tweak UITableView in order to behave like the grouped search results… 🙂


(source: mshcdn.com)

  • 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-07T17:05:49+00:00Added an answer on June 7, 2026 at 5:05 pm

    Update: I created a project on github, which does exactly this. I have extracted all the relevant code for the behaviour into two classes (BBFloatingHeaderViewController & BBFloatingHeaderCell). There is also an example project. I hope this is useful for others 🙂

    Here’s the project: besi/FloatingTableViewHeader

    This is an excerpt from the readme:

    Floating UITableView headers

    These classes aim to copy the behaviour found in iOS built-in Spotlight search, where the search results are grouped by category and the icon of the respective category floats on the left side of the search results.

    Setup

    Check out the example project so see how to setup the classes.

    1. Add the .m + .h files of BBFloatingHeaderViewController and BBFloatingHeaderCell to your project.
    2. Create a TableView and set the Class of the ViewController to your subclass of BBFloatingHeaderViewController
    3. Create the header cell in IB and set its class to your subclass of BBFloatingHeaderCell
    4. Make sure that your floating header view is the topmost view in the BBFloatingHeaderCell‘s view hierarchy.

    The result

    Floating Headers http://i.minus.com/jyea3I5qbUdoQ.png

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

Sidebar

Related Questions

I have a grouped UITableView that contains several cells (just standard UITableViewCell s), all
I have a grouped table view that utilizes two different custom table cells. When
I have custom background for my standard view and my grouped uitableview which I
I have a grouped UITableView which displays a number of cells, which includes both
I have Grouped Table View in which I want to display Contact details. But
I have table View with grouped style with three sections. Get information from dictionary
I have created a TableView(Grouped Table View). And I can list the items in
I have a grouped UITableView, with cells in section 2 depending on cells in
I'm using storyboard to create a grouped UITableView . Within the table I have
Do you know how to have some cells appear in a table view after

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.