andreamazz / AMScrollingNavbar

Scrollable UINavigationBar that follows the scrolling of a UIScrollView
MIT License
6.05k stars 634 forks source link

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

Open ManueGE opened 4 years ago

ManueGE commented 4 years ago

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

To Reproduce

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

ManueGE commented 4 years ago

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

andreamazz commented 4 years ago

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.