Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure header or footer height. #42

Open
bannzai opened this issue Oct 26, 2017 · 1 comment · May be fixed by #43
Open

Configure header or footer height. #42

bannzai opened this issue Oct 26, 2017 · 1 comment · May be fixed by #43

Comments

@bannzai
Copy link
Collaborator

bannzai commented Oct 26, 2017

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.

@xai3
Copy link
Owner

xai3 commented Oct 26, 2017

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

bannzai added a commit to bannzai/Shoyu that referenced this issue Oct 27, 2017
@bannzai bannzai linked a pull request Oct 27, 2017 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants