Header Row

Is it possible to have a row at the top of a table that behaves as a header (stays put)?
I can’t see an obvious way. I tried adding another table above, but I’m not thrilled with how that looks and behaves.


UITableView haas a HeaderView property: Apple Developer Documentation

You can get and set this view using iOSDesignExtensions
But the header will scroll with the table, I am not sure that is what you are looking for.

Yep, not quite. I do want it to be stationary.
I can use a container control but it’s above an inset grouped table. I’m concerned that the OS may change the amount of inset at some point and make it look “off”

But thanks Jeremie.

Can you just build header with Labels then put table below? This allows table to be scrolled and the header does not move. Works for me except in landscape mode the custom table adjusts for the phones with the the notch and does not line up any more with labels (bug report 64580) works fine in portrait view,

This is exactly what I’ve had to do.

Did you have any issues displaying in landscape with iPhones that have the speaker notch in the top?
Are you using customtablecell?

I just used a container control and had it constrained to the width of the table. I had thr table’s top set to the header’s bottom.
I’ve had no issue with the notch.

And I thought I was smart…lol

Guess I will have bone up on the Container control. Where you using a CustomTableCell in the container?

nope just a custom container.

Hi. Back at it again I am having no luck with container it is just doing the same as the label fields. You are getting the container to match the table fields?

In this case it might be easier to use an HTMLViewer to display such data.

So I would build an html file and then load in iOS using HTMLViewer?

Does that adjust for the notch?

And using the following CSS applied to the header, you can have a sticky header:

position: -webkit-sticky; /* Safari */  
position: sticky;

Thanks I will give it a shot. And I really appreciate the sticky header comment I am sure it would have taken a while to figure that out.