implement iOS navbar custom left & right view
This commit is contained in:
@@ -103,5 +103,15 @@ - (void)doric_navBar_setBackgroundColor:(UIColor *)color {
|
||||
[self.navigationController.navigationBar setBackgroundImage:UIImageWithColor(color) forBarMetrics:UIBarMetricsDefault];
|
||||
}
|
||||
|
||||
- (void)doric_navBar_setLeft:(UIView *)view {
|
||||
UIBarButtonItem *custom = [[UIBarButtonItem alloc] initWithCustomView:view];
|
||||
self.navigationItem.leftBarButtonItem = custom;
|
||||
}
|
||||
|
||||
- (void)doric_navBar_setRight:(UIView *)view {
|
||||
UIBarButtonItem *custom = [[UIBarButtonItem alloc] initWithCustomView:view];
|
||||
self.navigationItem.rightBarButtonItem = custom;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user