nwales
nwales

Reputation: 3561

Best approach for creating this custom UINavigationbar ios

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.

Upvotes: 0

Views: 650

Answers (1)

Richard
Richard

Reputation: 3296

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.

Upvotes: 1

Related Questions