2010-01-04 143 views
3

嗨,大家好,我創建了一個自定義的導航後退按鈕,但是當我添加此代碼時,我的後臺動畫不起作用,並返回動畫。爲什麼?我認爲這取決於我的@selector行動!導航欄上的自定義後退按鈕圖像不起作用! [iPhone SDK]

- (void)viewDidLoad { 


    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; 
    [button setImage:[UIImage imageNamed:@"goback.png"] forState:UIControlStateNormal]; 
    [button addTarget:self action:@selector(//HERE ! i don't know put what thing !) forControlEvents:UIControlEventTouchUpInside]; 
    [button setFrame:CGRectMake(0, 0, 32, 32)]; 
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button]; 


} 
+0

只是筆記...無需編寫self.navigationItem.leftBarButtonItem = [[的UIBarButtonItem頁頭] initWithCustomView:按鈕]。你可以直接編寫self.navigationItem.leftBarButtonItem =按鈕 – 2010-10-12 08:34:45

回答

3

好,我創建了一個功能和正常工作:d:

-(void)pushNav { 
[self.navigationController popViewControllerAnimated:YES]; 
} 
+0

方法可能應該被稱爲popNav以適應功能 – Mason 2015-02-22 02:39:38

相關問題