views:

17

answers:

0

i am not able to put my nav bar image properly as back button is making problem

this is my code

UIImage *image = [UIImage imageNamed: @"enjoynavbar.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage: image];

self.navigationItem.titleView = imageView;



//  UIBarButtonItem* btBack = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleDone target:self action:@selector(backButtonTapped)];
UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0, 0, 55, 30);
[button setImage:[UIImage imageNamed:@"backButton.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(backButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem* btBack = [[UIBarButtonItem alloc] initWithCustomView:button];  
self.navigationItem.leftBarButtonItem = btBack;