以下のコードは、私のアプリケーションで正常に動作しています。しかし、その leftbarbutton アイテムは見えません。また、背景画像を に設定できませんleftBarButtonItem
。何か間違ったことをしたのですが、何が間違っているのかわかりませんか?背景画像を表示して設定することはできますか?
UIImageView *NavigationBarImage =[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 44)];
NavigationBarImage.image=[UIImage imageNamed:@"mapbutton.png"];
[self.navigationController.navigationBar addSubview:NavigationBarImage];
self.navigationItem.hidesBackButton = YES;
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonItemStyleBordered target:self action:@selector(goBack)];
self.navigationItem.leftBarButtonItem = backButton;
-(void)goBack
{
[self.navigationController popViewControllerAnimated:YES];
}