Shoyu
Shoyu copied to clipboard
Configure header or footer height.
Why
It seems that behavior has changed when UITableView#heightForHeaderInSection
behavior return 0 and return tableView.sectionHeaderHeight
(-1) when it becomes iOS 11. Also delegate for footer has same problem.
Problem
When Using grouped style UITableView
- Until then(iOS 10.*)
- When return
0
inheightForHeaderInSection
, settingUIKIt/UITableView
configured implicity default height(about 20px). - When return
-1
, settingUIKIt/UITableView
configured implicity default height(about 20px).
- When return
- iOS 11
- When return
0
inheightForHeaderInSection
, setting truth zero height. (This is different from then) - When return
-1
, settingUIKIt/UITableView
configured implicity default height(about 20px).
- When return
When Using plain style UITableView
- Until then(iOS 10.*)
- When return
0
inheightForHeaderInSection
, setting truth zero height. - When return
-1
, setting ` setting zero height.
- When return
- iOS 11
- When return
0
inheightForHeaderInSection
, setting truth zero height. - When return
-1
, settingUIKIt/UITableView
configured implicity default height(about 20px). (This is different from then)
- When return
I faced when using grouped UITableView and not instanciate SectionHeaderFooterType.height(or heightFor(_:section:))
.
So, using Shoyu return 0
height via UITableView#heightForHeaderInSection
delegate method in this case.
But I confirmed iOS 10.3 simulator and iOS 11 simulator get difference height for header at this time.
How to resolve
I guess necessary switch
for UITableView.style
about returning height for delegate method.
Grouped UITableView
returning always tableView.sectionHeaderHeight
when not configure SectionHeaderFooterType.height(or heightFor(_:section:)).
Plain UITableViewreturning always
0when not configure
SectionHeaderFooterType.height(or heightFor(_:section:)).
I guess it is necessary switch
of UITableView.style
about returning height for delegate method
Grouped style UITableView return tableView.sectionHeaderHeight
when not configure SectionHeaderFooterType.height(or heightFor(_:section:))
.
Plain style UITableView return always 0
when not configure SectionHeaderFooterType.height(or heightFor(_:section:))
.
Plaase check this issue problem. Thank you.
@bannzai Hi! Thank you for reporting. I agree with your solution. Please to pull request. Thanks!