Questions tagged [uitableviewsectionheader]
218 questions
157
votes
12 answers
Changing Font Size For UITableView Section Headers
Can someone please instruct me on the easiest way to change the font size for the text in a UITableView section header?
I have the section titles implemented using the following method:
- (NSString *)tableView:(UITableView *)tableView…

JRD8
- 1,595
- 2
- 11
- 6
132
votes
16 answers
UITableView : viewForHeaderInSection: not called during reloadData:
I've set up the tableview with correct delegate and datasource linkages.. the reloadData method calls the datasource and the delegate methods except for viewForHeaderInSection:.
Why is that so?

inforeqd
- 3,209
- 6
- 32
- 46
22
votes
6 answers
How do you change the colour of a section title in a tableview?
Here is what I have at the moment.
How do I refer to this so that I can change the text colour to match my index list? The sectionForSectionIndexTitle worked well for adding in the correct section title but how exactly does one access the title…

AMAN77
- 6,218
- 9
- 45
- 60
15
votes
6 answers
UITableView Section Header Automatic Height Not Updated Properly
I am running into an issue with automatic/dynamic UITableView section header views that contain a UILabel that wraps (numberOfLines = 0). The height is not being calculated properly, especially once you scroll the table and the views are reused. …

outerstorm
- 712
- 3
- 7
- 16
14
votes
4 answers
UITableView Section Header not showing
I'm trying to make section headers with autolayout.
A simple header with a title and a counter
class ProfilePeopleListHeaderViewCell: UIView {
let titleLeftOffset = 12
let counterRightOffset = 5
let counterWidth = 50
var title = "title" {
…

Mikael
- 2,355
- 1
- 21
- 45
11
votes
1 answer
Collapsable Sections: [Assert] Unable to determine new global row index for preReloadFirstVisibleRow (0)
I'm implementing collapsable section headers in a UITableViewController.
Here's how I determine how many rows to show per section:
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return…

iOSProgrammingIsFun
- 1,418
- 1
- 15
- 32
10
votes
3 answers
How to set a custom cell as header or footer of UITableView
I am using Xib files instead of storyboard. I have created a table view with some dummy data. Its working fine, Now I have created a custom cell with some labels and textFields. How can I use it as header or footer of UITableView ?

Byte
- 629
- 2
- 11
- 29
9
votes
5 answers
Detect when UITableView section header snaps to the top of the screen
I want to detect when the UITableView section header snaps on top of the screen and then modify header's height, but I have no idea how to do that. Can anyone help?

Pakpoom Thaweesitthichat
- 233
- 1
- 3
- 7
7
votes
2 answers
Suggestion for UITextView is under floating header for UITableView
I have floating headers for my UITableView (which I want). But it looks quite bad when the suggestion view for the UITextView in the cell above is under the header.
Seems like no one has had this problem before. Any suggestions?
Both the header…

Sunkas
- 9,542
- 6
- 62
- 102
6
votes
2 answers
xcode warning "estimated section footer height before ios 11" what does it mean?
Does anyone know the meaning of this warning? I don't understand the problem it's describing. If I provided an estimated height when I shouldn't have, why is it a problem?
Here's some more info and screenshots:
My target is iOS 10, because I want…

bluegreen
- 384
- 3
- 15
5
votes
5 answers
UITableViewHeaderFooterView with SwiftUI content getting automatic safe area inset
I've got a basic UITableView with some cells. I'm using a SwiftUI View as content for both my cells and section headers. Strangely, only the section header that appears to touch the bottom of the screen on an iPhone XS Max seems to get a…

strangetimes
- 4,953
- 1
- 34
- 62
5
votes
4 answers
Swift - tableView Row height updates only after scrolling or toggle expand/collapse
I am using CollapsibleTableView from here and modified it as per my requirement to achieve collapsible sections. Here is how it looks now.
Since there is a border for my section as per the UI design, I had chosen the section header to be my UI…

Lohith Korupolu
- 1,066
- 1
- 18
- 52
4
votes
1 answer
Inset Grouped UITableView with Header Section
I have Used UITableView with Two prototype Cells and Inset Grouped style
Without viewForHeaderInSection Output will be fine
After Add viewForHeaderInSection Output will be Like this
Expected Output
Here is my code
extension…

Nikunj Kumbhani
- 3,758
- 2
- 26
- 51
4
votes
1 answer
How to arrange cells into sections with a custom header?
How would I be able to arrange the cells by sections with a custom header
I have code set to arrange the cells in the CartVC by brand(placing the brand in the CartHeaderCell). When the data is passed from the HomeVC to the CartVC, I can't get my…

Evelyn
- 186
- 1
- 4
- 25
4
votes
1 answer
UITableView Custom Section Header
I want to add to my UITableView some custom section headers, I've searched online and saw that many people are creating a UITableViewCell subclass and registering that as a header, it sounds like a bad practice since there's a specific class for…

Niv
- 517
- 5
- 18