iOS-Slide-Menu
iOS-Slide-Menu copied to clipboard
how to hidden menuLeftBarItem in navigationBar
Tell me please, how to hide -barButtonItemForMenu in viewController.navigationBar ?
Do you mean how to not show the menu button? because if that's what you want, you can set it using the delegate method. Check the documentation but to save some clicks, the left one is:
-(BOOL)slideNavigationControllerShouldDisplayLeftMenu{ return YES; }
Hope it helped.
Sep
thanks for the answer! I need to hide the icon "menu" on the navigation bar (LeftBarItem), but the menu should work with swype
can you [navigationbar setRighBarButtonItem:nil]?
Leave the swipe gesture on, but set the button to nil. Does that work?
[navigationbar setRighBarButtonItem:nil] - not worked :(
in example project:
#import "FriendsViewController.h"
@implementation FriendsViewController
-
(void)viewDidLoad { [super viewDidLoad];
[self.navigationItem setLeftBarButtonItem:nil]; // <-- this not work
[self.navigationItem setRightBarButtonItem:nil]; // <-- this work }
-
(BOOL)slideNavigationControllerShouldDisplayLeftMenu { return YES; }
-
(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 20; }
-
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"friendCell"]; cell.textLabel.text = [NSString stringWithFormat:@"Friend %ld", (long)indexPath.row]; return cell; }
@end
Help me, please, how to hide button "Menu" (on left side LeftBarButtonItem)