Giter Site home page Giter Site logo

animatingtableviewheader's People

Contributors

johndelong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

animatingtableviewheader's Issues

Header Bouncing when table reload

Hello John,

I found one issue in UITableview . By default you disabled estimate automatic in uitableview property in storyboard. But in my project that option was enabled. when i will move to other screen and whne i am coming back to previous screen that time i am reloading tableview in viewwillappear. that time my header is bouncing when scrolling time.

Note: Before pushing you just scroll at bottom. then navigate to other screen. when you are coming back to auto header screen and scroll tableview that time you will come to know issue.
Thanks.

FooterView not working

I tried adding the footerView. When the header is expanded and just scroll the tableview and can view the footerView , but when I try collapsing the header i.e, the tableView is expanded completely , the footerView is not viewed.

Edit:

  1. TableView Style - Plain
  2. Tried adding the footer view to your project, result it the same.

This one returns a sticky footer view, which I don't want.
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { return myView }

and this one return at the last, but not viewing properly.
self.tableView.tableFooterView = myView

Check the image here http://imgur.com/a/sNKkY

isScrollingDown and isScrollingUp - appear in revserse

When i scroll down, isScrollingDown derives as false and if i scroll up then isScrollingUp is false.

why this opposite calculation?

I have UISearchBar in place UIView.

when i scroll up, scrollView.contentOffset.y gives positive value. Should it not give negative?

Thanks
Ashish

func scrollViewDidScroll(_ scrollView: UIScrollView) {
        
        let scrollDiff = scrollView.contentOffset.y - self.previousScrollOffset
       
        let absoluteTop: CGFloat = 0;
        let absoluteBottom: CGFloat = scrollView.contentSize.height - scrollView.frame.size.height;
        
        let isScrollingDown = scrollDiff > 0 && scrollView.contentOffset.y > absoluteTop
        let isScrollingUp = scrollDiff < 0 && scrollView.contentOffset.y < absoluteBottom
       
        var newHeight = self.searchBarHeightConstraint.constant


        if isScrollingDown {
            newHeight = max(self.minHeaderHeight, self.searchBarHeightConstraint.constant - abs(scrollDiff))
            
        } else if isScrollingUp {
            newHeight = min(self.maxHeaderHeight, self.searchBarHeightConstraint.constant + abs(scrollDiff))
            

            newSearchBar.showsScopeBar = false
            
        }

      if newHeight != self.searchBarHeightConstraint.constant {
            self.searchBarHeightConstraint.constant = newHeight
            self.setScrollPosition(position: self.previousScrollOffset)

        }

        self.previousScrollOffset = scrollView.contentOffset.y

{

Header late to expand upon scroll up when table view has bottom layout margins or content inset

Thanks so much for this code and blog post; so useful!

I noticed an odd behavior where when I'd scroll up from the bottom, the header would be late to un-collapse... I'd have to get a couple cells up from the bottom before it started to un-collapse.

In my case I'm using this technique on a collection view appearing inside a UITabBarController, where the collection view scrolls under the bottom bar.

It occurred to me the amount I was needing to scroll up before triggering the uncollapse was roughly the height of the bottom bar. I realized that the calculation of absoluteBottom probably needs to take this extra space into account.

After accounting for the layout margins (and content inset, same issue) in the absoluteBottom calculation, the un-collapse is now pixel-perfect!

I'll have a PR for you in a second to account for it on this project too. But I wanted to document this in an issue in case someone else was running into the same problem.

Search Bar does not always expand

Hey! This is a great project you worked on but I found one issue. I changed numberOfRowsInSection to return 5. Now if you try collapse the header, nothing will happen.
Thanks again for the awesome blog post ๐Ÿ‘

Laggy header when scrolling tableview with image cell

I'm having an issue when my table view cell rendering image for the first time, the header seems to be stretched suddenly right just before the table view was about to display that image cell. It's happened to be tableview's contentOffset get changed somehow in this case when rendering image.I'm having self-sizing table view cell implemented by the way.
Any ideas what's going on? Thanks a lot for your elegant tutorial.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.