导航栏上的自定义后退按钮图像不起作用! [iPhone SDK]

时间:2010-01-04 09:31:18

标签: iphone button sdk

大家好我创建了一个自定义导航后退按钮,但是当我添加此代码时,我的后期动画无效并返回动画。为什么?我认为这取决于我的@selector动作!

- (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];


}

1 个答案:

答案 0 :(得分:3)

好吧我创建了一个功能并且工作正常:D:

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