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