Questions tagged [uitableviewsectionheader]

204 questions
142
votes
11 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,447
  • 2
  • 11
  • 6
130
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,099
  • 6
  • 29
  • 45
18
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
  • 5,580
  • 7
  • 42
  • 59
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. …
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,343
  • 1
  • 13
  • 28
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
  • 601
  • 2
  • 9
  • 27
10
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,155
  • 1
  • 18
  • 42
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
  • 8,816
  • 5
  • 55
  • 94
5
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
  • 346
  • 1
  • 4
  • 20
5
votes
1 answer

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…
5
votes
3 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?
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…
4
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,039
  • 1
  • 16
  • 48
4
votes
2 answers

iOS add button to right side of UITableViewHeaderFooterView

I have a table view and would like one section's header to have a right aligned button. Ideally I could add the button to UITableViewHeaderFooterView so as to get its header font type, size and color. In my tableView(tableView: UITableView,…
Steve Kuo
  • 58,491
  • 75
  • 189
  • 247
4
votes
3 answers

Swift - Header in UITableView blocks button interaction

In my UITableView I want to have an option to click a button which have a fixed posision (see attached picture). But anything that is in front or behind the UITableView's section headers is blocked from interaction, it does not register the button…
1
2 3
13 14