我設置一步和下一步按鈕,導航欄項目左鍵和右鍵button.which低於代碼導航欄按鈕隱藏在動畫設置爲YES
// Back Button
UIBarButtonItem *aBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:aButton];
[aButton addTarget:self action:@selector(navigatehome)forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.leftBarButtonItem = aBarButtonItem;
//Next Button
aBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:aButton];
[aButton addTarget:self action:@selector(navigatenext)forControlEvents:UIControlEventTouchUpInside];
[self.navigationItem setRightBarButtonItem:aBarButtonItem]
和解決問題時animated:YES
在聲明中
CSA_info *h1=[[CSA_info alloc]init];
[self.navigationController pushViewController:h1 animated:YES];
它顯示如下圖像
如果使用animated:No
則表現如下
我在導航欄上添加圖片作爲子視圖,以便它隱藏的按鈕。
UIImage *image = [UIImage imageNamed:@"title bar.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = CGRectMake(-5, 0, 330, 44);
[self.navigationController.navigationBar insertSubview:imageView atIndex:2];
我需要在導航欄中添加該圖像。
爲什麼這樣,任何幫助?
刪除的圖像,並設置按鈕的背景顏色,那麼請讓我知道如果你仍然面臨着同樣的一點改進。 – 2013-05-01 13:57:46
你能否解釋一下,你在哪裏設置UINavigationBar的右鍵和左鍵。它在CSA_info類中嗎? – 2013-05-01 13:58:00
你必須impliment這個代碼在viewViewAppear – 2013-05-01 14:08:13