0

I am creating a UINavigationBar that will expand and contract in various states. The top image is when it is in a contracted state with a transparent background. The lower image represents when it has expanded with a background and search bar. As the user scrolls down the nav bar background would animate in and expose the search field.

enter image description here

enter image description here

Can someone suggest the best way to build this?

So far I've explored subclassing the UINavigationBar, but I've been having a really tough time with the placement of the items within the nav bar or hooking that view up to a xib. I've also see examples where the extended content is just a UIview anchored to the top of the view controller top margin, but then I'm splitting the appearance of my nav into two views which will make the animation problematic.

nwales
  • 3,521
  • 2
  • 25
  • 47

1 Answers1

1

According to the answer to UISegmentedControl below UINavigationbar in iOS 7 it can be accomplished using a UIToolBar and some delegate methods.

You might have to tweak it a little bit however, to fit the search bar that you want to include.

Community
  • 1
  • 1
Rick
  • 3,240
  • 2
  • 29
  • 53