-
Notifications
You must be signed in to change notification settings - Fork 339
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
Fix for tableView headers #29
base: master
Are you sure you want to change the base?
Conversation
This sounds fantastic, I'll take a look this week. Thank you! |
@DanielKrofchick yep, I'll update it! |
@DanielKrofchick updated. |
@bryankeller any updates on this? |
After finals next week. Really sorry for keeping this and a few other PRs up so long. Just have to prioritize school before I can take a serious look at these. |
Absolutely! good luck your finals! |
Hey @palcalde, this is great. Thanks for taking the time to figure this out. I tried it out and it works really well. Before I merge this in, I want to discuss this point that you made:
I see that you give Hypothetically, what if Apple releases a class in the future that does calculations based on content inset? Adding another initializer every time Apple does this isn't feasible. With that said, what if we implement your content inset adjustment code for all
Lastly, just a couple of super minor things. If you can change your Thanks again for fixing this. I know a lot of people came across this issue and will appreciate a fix. Let me know if you have any thoughts on what I said. |
good morning @bryankeller! It makes sense to me the separation of concerns that you want to have. I'll update the pull request with your points soon and let you know. |
@bryankeller After taking a look, these are the issues I see with the implementation you propose: The only solution that comes to my mind, without tightly coupling FlexibleHeightBar with the ScrollView, is to have FlexibleHeightBar notify the behaviorDefiner whenever layoutSubviews did get executed. To do this we would have to:
Let me know if this makes sense or if you find a better solution. |
@palcalde Unfortunately, I just noticed an issue with this method (the one implemented in your PR). It causes strange and abrupt scroll view deceleration whenever the content inset is being tweaked on the fly. I'm looking into this now. Regarding your suggestions - it sounds like it would work, but I'd still like to investigate other possible solutions before committing to that, especially since there seems to be some issues with adjusting content inset. |
@bryankeller sure, if you found an issue with the implementation of the PR take your time to find other solutions. Np! |
Any progress on this, folks? I spent a bit of time playing with BKLFlexibleHeightBar tonight and ran into the issue described here... although for a UICollectionView. (An additional reason why the more general solution and separation of concerns that @bryankeller mentioned above is important). |
It sounds like you all have been really busy, but I had a question about this fix. Currently this assumes we will be using initWithFrame. If we are getting the layout from a xib file, would the best way to modify this be to create a setTableView method for the bar object? |
Any progress? |
@bryankeller This solves the issues with the tableView headers in #8
and maybe in (didn't test it) #14
Section headers in UITableView are based on contentInset. If the bar shrinks, the tableView needs to have contentInset udpated in order to have the headers scroll smoothly.
I don't think there is a need to change the contentInset for all UIScrollView's (just for the ones that are UITableViews) so I created one initializer in the bar to pass the tableview. This way people can still use the regular initializer you created for UIScrollViews.
Finally, I had to change scrollViewDidScroll of SquareCashStyleBehaviorDefiner. It was doing a check based on the contentInset and since that changes now, it didn't work well. Now is based on the max bar height which works great.
Hope this helps!