gskbyte / GSKStretchyHeaderView

A generic stretchy header for UITableView and UICollectionView
MIT License
1.75k stars 187 forks source link

TableView does not show the header #100

Open mulp opened 4 years ago

mulp commented 4 years ago

Hi I'm getting, a weird behaviour using the lib, when I run the app I get the app with the table view set to 0,0 position of the screen. This problem is not happening on ios 13.2.1, it happens on earlier version. If I scroll down I can see the header view and it works as expected, the issue is that when it starts for the first time it is hidden.

Screenshot 2019-12-02 at 23 00 42 Screenshot 2019-12-02 at 23 01 15

This is the setup of my stretchy view:

    private let stretchyHeader: StretchyHeaderView = {
        let stretchyHeader = StretchyHeaderView(headerHeight: 350)
        stretchyHeader.expansionMode = .topOnly
        return stretchyHeader
    }()

I set it as subview of my table view in the viewDidLoad() method. The StretchyHeaderView is a custom subview where I setup a main image with auto layout, I use snapkit. The image is constrained to all the edges of the content view. If I inspect the view using the UI debugger I can see that the StretchyHeaderView has a weird value of height of -0.

Do you have any suggestions? Thanks.