My Doubt is How to hide Navigation Bar title "BACK" from backbutton (but need to show backbutton Arrow.)
Thank You.
My Doubt is How to hide Navigation Bar title "BACK" from backbutton (but need to show backbutton Arrow.)
Thank You.
Use this:
YourViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"YourViewController"];
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
[self.navigationController pushViewController:viewController animated:YES];
I suggest you use code like below :
- (void)configureNavigationBarButtonItem
{
UIButton *cancel = [UIButton buttonWithType:UIButtonTypeCustom];
[cancel setFrame:CGRectMake(0, 0, 50, 50)];
[cancel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[cancel.titleLabel setFont:[UIFont fontWithName:@"Verdana" size:13.0f]];
cancel.contentHorizontalAlignment=UIControlContentHorizontalAlignmentLeft;
[cancel addTarget:self action:@selector(goBack:) forControlEvents:UIControlEventTouchUpInside];
cancel.tag=3200;
imgBack = [[UIImageView alloc]initWithFrame:CGRectMake(5, 15, 18, 18)];
imgBack.image = [UIImage imageNamed:@"back_black"];
[cancel addSubview:imgBack];
UIBarButtonItem *cancelBtn = [[UIBarButtonItem alloc] initWithCustomView:cancel];
self.navigationItem.leftBarButtonItem = cancelBtn;
}
- (void)goBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}