OfTheWolf / TwitterProfile

Nested scrolling with pager just like in Twitter and Instagram profile.
MIT License
266 stars 45 forks source link

Disable stretchy header effect. #4

Closed brightroots7 closed 4 years ago

brightroots7 commented 4 years ago

How to disable the stretchy header while scrolling down,

OfTheWolf commented 4 years ago

@brightroots7 you can play with the headerFrame in MasterViewController.swift. You can remove first if statement "scrollView.contentOffset.y < 0 block". See below.

MasterViewController.swift. Lines between 138 - 141
        if scrollView.contentOffset.y < 0{
//            headerView.frame = CGRect(x: headerView.frame.minX,
//                                      y: min(topHeight, scrollView.contentOffset.y),
//                                      width: headerView.frame.width,
//                                      height: max(dataSource.headerHeight().lowerBound, dataSource.headerHeight().upperBound + -scrollView.contentOffset.y))

        }else{
            headerView.frame = CGRect(x: headerView.frame.minX,
                                      y: 0,
                                      width: headerView.frame.width,
                                      height: dataSource.headerHeight().upperBound)
        }