iOS-Slide-Menu icon indicating copy to clipboard operation
iOS-Slide-Menu copied to clipboard

how to hidden menuLeftBarItem in navigationBar

Open DmitryShapovalov opened this issue 9 years ago • 5 comments

Tell me please, how to hide -barButtonItemForMenu in viewController.navigationBar ?

DmitryShapovalov avatar Dec 01 '15 10:12 DmitryShapovalov

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

SCLDev avatar Dec 01 '15 11:12 SCLDev

thanks for the answer! I need to hide the icon "menu" on the navigation bar (LeftBarItem), but the menu should work with swype

DmitryShapovalov avatar Dec 01 '15 12:12 DmitryShapovalov

can you [navigationbar setRighBarButtonItem:nil]?

SCLDev avatar Dec 01 '15 13:12 SCLDev

Leave the swipe gesture on, but set the button to nil. Does that work?

SCLDev avatar Dec 01 '15 13:12 SCLDev

[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)

DmitryShapovalov avatar Dec 01 '15 15:12 DmitryShapovalov