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

Usage in TabBarController #138

Open vito-royeca opened 8 years ago

vito-royeca commented 8 years ago

Can I use this inside a UITabBarController?

ivanlovrenovic commented 8 years ago

This is already a confirmed bug, check issue #102. No solution has yet been published by Mazyod but I found a fix that may be used if you would like to use it in a TabBarController. Remember that the fix was written for my own app to use TLYShyNavBar and may not work with your solution (depending on how your view is constructed). Here is my solution that i wrote as a comment on issue #102.

"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."

vito-royeca commented 8 years ago

Thanks by the way. I did what you suggested, but then the nav bar will not scroll up anymore.

ivanlovrenovic commented 8 years ago

Hmm, strange. Must be your setup then, because it worked for me in my own app aswell as in the demo-app. Have you tried the fix on the demo app? Did or work? Sorry that i cant be anymore of a help, it's hard to help you without any line of code im afraid.

vito-royeca commented 8 years ago

Well, my table view is inside a navigation controller which is inside a tab bar controller.

I tried the fix by adding "insets.bottom = 0;" inside the TLYShyScrollViewController.m itself.

Please take a look at the FeaturedViewController.swift in my project:

Cineko