TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | eclipse |
ReleasedLast Release | Jun 2015 |
Maintained by Todd Anderson.
Open source implementation of resizable navigation bars in iOS
This project was inspired by Level Money's shift to large navigation headers in iOS and Apple's inability to correctly support this functionality. We were unable to find any implementation, although much of the original research and inspiration behind this project came from edmentec (http://www.emdentec.com/blog/2014/2/25/hacking-uinavigationbar)
Replace UINavigationController with LVResizableNavigationController. Then, in any UIViewController that needs to modify the navigation height, implement the protocol LVResizableNavigationBarController.
** If you are using a storyboard, you will also need to change the navigation bar class to LVResizableNavigationBar.
The code was written in such a way that using LVResizableNavigationController without implementing the LVResizableNavigationBarController protocol will not cause any problems.
// Height for navigation bar -> should be larger than 44.
// If not implemented, 44 is assumed
- (CGFloat)resizableNavigationBarControllerNavigationBarHeight;
// Not required in order to change the BarTintColor but
// necessary if you want to animate color changes between pushes
- (UIColor *)resizableNavigationBarControllerNavigationBarTintColor;
// Optionally place a subview in the Navigation Bar.
// subview frame is determined by Navigation bar:
// {0, 44, screenWidth, resizableNavigationBarControllerNavigationBarHeight - 44}
- (UIView *)resizableNavigationBarControllerSubHeaderView;
Feel free to read through the code. It is a bit hacky and could struggle in future versions of iOS.