AMScrollingNavbar icon indicating copy to clipboard operation
AMScrollingNavbar copied to clipboard

How to move up Toolbar and hide it with navigation bar?

Open aloveric opened this issue 8 years ago • 2 comments

navigationController.followScrollView(table, followers: [tabBarController.tabBar, toolbar])

This will make navigation bar hide, but Toolbar still on the top. How to hide the Toolbar when scroll up?

aloveric avatar Aug 15 '17 08:08 aloveric

I propose adding a new property named downwardFollowers or similar where would try to move those views towards the bottom when navigation bar hides.

Thoughts?

attheodo avatar Nov 28 '17 12:11 attheodo

@attheodo sounds good, more on that, we could probably encapsulate the view in a struct with the direction, something like

enum FollowerDirection { case up, down, left, right }

struct Follower {
  var view: UIView
  var direction: FollowerDirection

  init(view: UIView, direction: FollowerDirection) {
  // ...
}

then:

navigationController.followScrollView(table, followers: 
  [Follower(view: topBar, direction: .up),
  [Follower(view: bottomBar, direction: .bottom)]
)

This could be fairly easy to implement and a good starting point if someone wants to contribute.

andreamazz avatar Nov 28 '17 14:11 andreamazz