Skip to content
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

Navigation bar appears at the wrong height when switching back to Eateries tab #297

Open
whoiswillma opened this issue Sep 4, 2020 · 1 comment

Comments

@whoiswillma
Copy link
Contributor

Recreate:

  1. Open eateries page and open an eatery
  2. Open lookahead tab
  3. Go back to eateries page
  4. Use the left-swipe gesture to go back to the Eateries page
  5. The navigation bar is now too high up, but this fixes itself when you scroll or do anything
@whoiswillma
Copy link
Contributor Author

whoiswillma commented Sep 6, 2020

If someone decides to pursue this bug in the future: here's what I've learned.

  • The bug is caused by hiding and showing the navigation bar while a search bar exists. It seems like a bug with UINavigationController. Admittedly, showing and hiding the nav bar is a bit suspicious. But it works perfectly without a search bar, and even has a custom animation (see Transit iOS pushing the routes VC)

  • If you remove the fake navigation bar in CampusMenuViewController (added by its superclass) and replace it with the real navigation bar, then you encounter ANOTHER bug with UINavigationController and Hero. EIther Hero specifies the wrong animation duration, or the navigation controller doesn't animate the navigation bar properly. In either case, the navigation bar is still animating after the view becomes interactive. If you try implementing this:

    1. Open the menu for an Eatery at the top of the page
    2. Press the back button in the top left
    3. Spam-press where another Eatery will be (or learn the timing and press it while the nav bar is still animating)
    4. Watch the search bar be stuck in the middle of the screen

IMG_281C7BECAD09-1

So I've abandoned this strategy.

  • I've given up on this for now, but to future me (or someone else), try forcing the navigation bar to recompute its frame just a moment after the user releases their finger. Either that, or replace the navigation bar on the EateriesViewController with another fake navigation bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant