Questions tagged [uitableviewsectionheader]
218 questions
1
vote
1 answer
Is there a way to match Number of Sections match Dictionary Keys count in UITableViewDiffableDataSource
I am trying to Group names by first Character and display it in ViewController using the new UITableViewDiffableDataSource.(e.g. Contacts Application)
**A** (header title)
Apple
Amazon
**B** (header title)
Broadcom
Bezoz
**C** (header…

Rajiv
- 27
- 7
1
vote
1 answer
How to get a custom section header's background to respond to scrolling in table view
In iOS 15 section headers views will change to a gray blurred background as you scroll the table view.
How do you mimic or adopt this same behavior for custom section header views? I'm returning a label as my custom view.
- (UIView…

Berry Blue
- 15,330
- 18
- 62
- 113
1
vote
1 answer
Extra space at section header in UITableView with Autolayout
I have a UITableViewController that has:
UIView for the tableHeaderView
UIView for sectionHeaderView
UITableViewCell for the cells of the tableview
UIView for the tableFooterView
I have the UITableViewController in my storyboard, and there is…

Miguel
- 558
- 6
- 21
1
vote
2 answers
sectionHeaderTopPadding doesn't apply on Grouped and InsetGrouped UITableView
since iOS15 a strange top gap started to appear
after research i found out that
if #available(iOS 15, *) {
tableView.sectionHeaderTopPadding = 0
}
should solve the issue
however this works only for plain style table (UITableView.Style.plain),…

Peter Lapisu
- 19,915
- 16
- 123
- 179
1
vote
0 answers
UITableview inside cell, second UItableview only 1 row, should be more than 1 row
So I'm trying making a multi-level UITableView by using UITableView inside UITableViewCell. Let me explain first:
Red color is Main UITableView
Blue color is Section, so I use as SectionHeader, and add UIButton into it, so can be expanded,…

Axel
- 73
- 1
- 11
1
vote
1 answer
first tableview headerview disappears after scroll but every other one stays visible
So my goal is to have my first tableview headerview stay visible after scroll down. So I have a tableview with an inset grouped style so that the headers move up with the cells, when the view loads, the first header label is visible like so:
This…

dante
- 105
- 11
1
vote
0 answers
Swift - UISearchController Results displayed Large spacing between search bar and TableView Cells
Sorry for the image being large I haven't posted on SO in a while. Anyways, my UISearchController displayed results create a large spacing between the searchbar and tableview cells. This is a very inconsistent bug. What is the correct way to stop…

Lukas Bimba
- 817
- 14
- 35
1
vote
1 answer
Dynamic section header height on runtime
I have UITableView in view controller with a section header and in the header, I have one UITextView with scroll disabled and pinned all UITextView edges to its super view.
Here is the code for automatic height change
func tableView(_ tableView:…

Bhavin Bhadani
- 22,224
- 10
- 78
- 108
1
vote
0 answers
Collection view not showing when using a UITableViewCell as the HeaderView
I'm trying to embed a collection view in a custom UITableViewCell I am using as the HeaderView of each of my table view cells. This is the hierarchy I am using in the storyboard
And this is the code of the Custom Header Table View Cell. The…

Francisco Ruiz
- 209
- 3
- 12
1
vote
1 answer
How to add header to each row in a table view
I'm building an iOS app with a collection view inside the table view. I'm having three rows each row having a collection view inside it. I am planning to have three sections each section for each row. For example row, one should be in a separate…

user11640506
- 57
- 2
- 8
1
vote
1 answer
tableview last section is scrambled when setting row height to 0 swift
I added an arrow to fold the section when clicked, when I fold the last section (e.g. setting the row height to 0 in cellForRow, all the rows in the last section get mixed up, as can be seen in the image below:
Can anyone suggest any reason why…

Idanis
- 1,918
- 6
- 38
- 69
1
vote
0 answers
Why searchController nested in the tableView scrolled under the navigationBar?
I have tableViewController at the storyboard.
I programmatically added searchController to the table header.
private func setupSearchView(){
if !showSearchBar { return }
let storyboard = UIStoryboard(name: "Search", bundle: nil)
…

Vadym Marchenko
- 29
- 1
- 7
1
vote
1 answer
UITableView with Multiple Sections in Alphabetical Order using Realm and Swift, with multiple labels connected with same data
Been trying to solve this for over 10 days now and still haven't had any luck fixing the situation.
I am trying to add sections to the table view in alphabetical order from A-Z based on the names of "ExerciseName" column. Also i have a…

Santhosh Umapathi
- 43
- 6
1
vote
2 answers
Pass section to handle click UISwitch in UITableViewCell - Swift
I am working with UISwitch in UITableViewCell and I am passing the row like bellow:
.....
cell.swcSelectCourse.tag = indexPath.row
cell.swcSelectCourse.addTarget(self, action: #selector(handleSWCSelectCourse(sender:)), for:…

jo jo
- 1,758
- 3
- 20
- 34
1
vote
1 answer
How to update UITableview Header height while scrolling programatically
In My application I have top navigation bar and a tableview below the navigation bar. I have CollectionViewCell with two rows which added inside the UITableViewHeader programmatically. When ever I scroll the the TableView to top, i want the header…

Madhu
- 869
- 1
- 17
- 37