Hi Guys,
I want to disabled the default back button of navigation controller
self.navigationItem.rightBarButtonItem.enabled = NO; self.navigationItem.leftBarButtonItem.enabled = NO;// not working how can we disabled here.
I have done it with manually shown below, But Is there any property to disabled the default back button with just single line?
backButton = [[UIButton alloc] initWithFrame:CGRectMake(5, 5, 100, 30)]; [backButton setBackgroundImage:[UIImage imageNamed:@"backbutton_100.png"] forState:UIControlStateNormal]; [backButton addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside]; [backButton setTitle:@" All Customers" forState:UIControlStateNormal]; backButton.titleLabel.font = [UIFont boldSystemFontOfSize:12]; [buttonView addSubview:backButton];
UIBarButtonItem* leftButton = [[UIBarButtonItem alloc] initWithCustomView:buttonView];
self.navigationItem.leftBarButtonItem = leftButton;
[leftButton release];
self.navigationItem.leftBarButtonItem.enabled = NO;// now it is working.