Implements a navigation bar behaviour such as the one in Safari app. Allows some kind of behaviour customization.
- iOS 7.0
- ARC
- Inherit your UIViewController class containing the UIScrollView/UITableView with EMLResizableNavigationBarViewController.
- Set the UIScrollView/UITableView delegate to self.
- You are done!
NOTE: You cannot inherit directly from UITableViewController. To use EMLResizableNavigationBar with a UITableView you need to create a property table view inside a UIViewController and adopt UITableViewDataSource plus UITableViewDelegate.
@interface EMLDemoViewController : EMLResizableNavigationBarViewController <UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, weak) IBOutlet UITableView *tableView;
@endAdd a title:
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"nav_logo"]];or
self.title = @"ResizableBar";Hide the bar just half its size:
self.resizableBarResizePercent = 0.5f;Show the title even when the bar is hidden:
self.resizableBarTitleDisappears = NO;EMLResizableNavigationBar is available through CocoaPods.
pod "EMLResizableNavigationBar"Import the following files into your project:
EMLResizableNavigationBar/Pod/Classes folder:
EMLResizableNavigationBarViewController.h
EMLResizableNavigationBarViewController.menric.macias.lopez, [email protected]
EMLResizableNavigationBar is available under the MIT license. See the LICENSE file for more info.
