telly / TLYShyNavBar

Unlike all those arrogant UINavigationBar, this one is shy and humble! Easily create auto-scrolling navigation bars!
MIT License
3.73k stars 427 forks source link

TabBarController breaks bottom tableView constraint #102

Open acarella opened 8 years ago

acarella commented 8 years ago

First: this is an awesome library, thanks so much for writing it.

I'm using a tabBar controller in my project, with a navigation controller in the second tab, and a UIViewController as the root of that navigation controller. I have a tableView that I'm setting as my shyNavBarManager scrollView.

I also have an extension view that I'm using.

When I scroll up, it appears that the bottom constraint that holds the tableView to the UIViewController view gets broken, although, Xcode doesn't generate any warnings about this, so perhaps this isn't the case. Anyway, what does happen is the bottom of the tableView appears to slide upwards with the scroll.

I'm including screenshots of the simulator, and Xcode's view debugger.

This happened in a project I'm working on and I was able to reproduce it by inserting a tabBar controller into the swift demo project, and connecting it to the navigation controller with a relationship segue.

The amount that the tableView slides up varies with each run of the app.

screen shot 2015-12-11 at 11 06 33 am screen shot 2015-12-11 at 11 07 10 am
Mazyod commented 8 years ago

Thanks for reporting this, I am hoping to get around to the issues here over the next couple of weeks. Will review any PR ASAP as always, though.

rwinzhang commented 8 years ago

+1 I have the same issue :(

ivanlovrenovic commented 8 years ago

I have the same issue. Has there been a fix or a workaround for this yet?

ivanlovrenovic commented 8 years ago

Writing a comment about a possible fix/workaround for this issue. I haven't had the chance to test the solution perfectly so use the fix at your own risk. What I have tested is that the solution doesn't break anything else in the demo app and it is because of that reason I decided to comment the solution.

In the file "TLYShyScrollViewController.m", just after setting "insets.top = normalizedY;", allocate the insets bottom parameter aswell to 0. In other words, after "insets.top = normalizedY;", add "insets.bottom = 0;"

This worked for me in my own app, aswell as in the demo app provided by Mazyod.

Agoer commented 8 years ago

insets.bottom = 0 is ready for the bug