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

Table view buttons and title disappears after going back from full screen presented controller #375

Open
ManueGE opened this issue Nov 20, 2019 · 2 comments

Comments

@ManueGE
Copy link
Contributor

ManueGE commented Nov 20, 2019

Describe the bug
Table view buttons and title disappears after going back from full screen presented controller.

To Reproduce

  • Start observing a collection view (or table view) scroll.
  • Scroll to hide the nav bar
  • Present a modal view controller with full screen
  • Stop observing (in viewWillDissapear) with showingNavBar = false
  • Dismiss the presented view controller
  • The original controller has the nav bar displayed and all its items (title, buttons) are transparent.

You can also reproduce it by adding this code to CollectionViewController.swift in the demo app.

// line 38, replace commented line
// navigationController.stopFollowingScrollView()
navigationController.stopFollowingScrollView(showingNavbar: false)
// line 44, replace commented lines
// let storyBoard = UIStoryboard(name: "Main", bundle: nil)
// let mainViewController = storyBoard.instantiateViewController(withIdentifier: "TestViewController")
// self.present(mainViewController, animated: true, completion: nil)

let c = UIViewController()
c.modalPresentationStyle = .fullScreen
c.view.backgroundColor = .red
present(c, animated: true)
Timer.scheduledTimer(withTimeInterval: 2, repeats: false) { _ in
  c.dismiss(animated: true, completion: nil)
}

Expected behavior

  • The nav bar should remain hidden or at least visible with all this items
@ManueGE
Copy link
Contributor Author

ManueGE commented Dec 4, 2019

Also, after going back the navigation bar has isUserInteractionEnabled = false, so it's not tappable.

@andreamazz
Copy link
Owner

Hey @ManueGE
I think this is UIKit enforcing the navbar height when returning from the presentation, I reckon I have no way of controlling this. The only workaround that I can offer is not calling the stopFollowingScrollview method, the result is not seamless, but it works.

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

No branches or pull requests

2 participants