gskbyte/GSKStretchyHeaderView

iOS 11 Header problem

victorpierre789 opened this issue · 14 comments

Hi,
There is a small problem with GSKStretchyHeaderView on iOS 11, above the tableview there is a blank space, how to fix the problem is urgent for me. Can you help me ? Thanks
Watch the screenshots :

simulator screen shot - iphone 8 - 2017-09-26 at 13 45 55
simulator screen shot - iphone 8 - 2017-09-26 at 13 49 26

This should be solved by the following option for UIScrollView

scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

@mrhaxic It works. Thank you very much my friend, you have an idea to solve a problem related to iPhone X ?

simulator screen shot - iphone x - 2017-09-26 at 14 02 00

Nice, I love all these hacks Apple introduces with every new iOS version :)

I'll update the examples and everything to improve the behaviour on iOS 11 as soon as the CI supports it!

@victorpierre789 for that model specifically, you might need to make some adjustments to the layout... I will try to make the library work better with iOS 11 this week so all these hacks are not needed

@gskbyte Okay thanks :)

Hi gskbyte, any news for us ?? 👍 🥇

I have found a couple of issues with iOS 11, however, I'm working on it: #64

Feel free to have a look at the PRs I will open!

After enabling compatibility with Xcode 9 I will try to fix these problems with iOS11 without altering the API of the header view, but I can't promise anything, this looks harder than I initially thought.

@gskbyte
Have you been able to look into the issues in xcode 9 and iOS 11? Would be great if you can update us whether you are fixing it.

Hi,

I just had time to setup the project on Xcode 9 and make the build pass on the CI, I will try to invest more time this weekend and ideally come up with a general solution that works well on both iPhone 8 and X, respecting the safeAreaInsets. But take into account that this can take me several days.

In the meanwhile, if it's enough for you, use the header view as in the example "below the navigation bar", that works as expected in all systems if contentInsetAdjustmentBehavior = .never

Any help is more than welcome :)

Best regards

@gskbyte In UICollectionView the Section Headers (UICollectionReusableView) appear on top of the GSKStretchyHeaderView. This seems like the view hierarchy has changed in iOS 11.
Is there any way you know that this could be solved?

@gskbyte I also faced this problem. It is very strange behavior as reported by @suyashb734
simulator screen shot - iphone 7 - 2017-10-11 at 14 34 26

Hello!

I think I have fixed the issues, at least partially. I have opened the following PR: #68

The way to stop iOS 11 messing up with the contentInsets is to do the following:

    if (@available(iOS 11.0, *)) {
        self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }

However, this is not a very good solution for the iPhone X and you may require some manual adjustments for that case, like setting a bigger maximumContentHeight for it and adjusting the layout of the header view contents.

And the issue with the collection view headers is know on iOS 11: http://www.openradar.me/34308893. I have implemented a little hack to solve it.

Please have a look at the PR, I will merge it this afternoon and will release a patch version.

To fix the problems with the notch and the iPhone X I think I will need some major refactor for the header view that might not be backwards compatible. Managing the adjusted contentInset is not possible using KVO anymore and this makes the whole concept of the header view more complicated.

I'll keep you posted!

I still get this issue with iOS 12 and iPhone X, minimumContentHeight doesn't work, stretch Factor ends on not zero value.
Just now checked on iPhone 8, and the behaviour also weird. I set minContentHeight to 0, but header not going to be 0.