Shoyu icon indicating copy to clipboard operation
Shoyu copied to clipboard

Configure header or footer height.

Open bannzai opened this issue 7 years ago • 1 comments

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 in heightForHeaderInSection, setting UIKIt/UITableView configured implicity default height(about 20px).
    • When return -1, setting UIKIt/UITableView configured implicity default height(about 20px).
  • iOS 11
    • When return 0 in heightForHeaderInSection, setting truth zero height. (This is different from then)
    • When return -1, setting UIKIt/UITableView configured implicity default height(about 20px).

When Using plain style UITableView

  • Until then(iOS 10.*)
    • When return 0 in heightForHeaderInSection, setting truth zero height.
    • When return -1, setting ` setting zero height.
  • iOS 11
    • When return 0 in heightForHeaderInSection, setting truth zero height.
    • When return -1, setting UIKIt/UITableView configured implicity default height(about 20px). (This is different from then)

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 always0when 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 avatar Oct 26 '17 10:10 bannzai

@bannzai Hi! Thank you for reporting. I agree with your solution. Please to pull request. Thanks!

xai3 avatar Oct 26 '17 14:10 xai3