时间:2010-07-23 19:34:47

标签: iphone xcode uinavigationcontroller

3 个答案:

答案 0 :(得分:4)

使用此代码:

UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0,0,36,30);
[button setBackgroundImage:[UIImage imageNamed:@"backgroundImage.png"] forState:UIControlStateNormal];

[button addTarget:self.navigationController action:@selector(popViewControllerAnimated:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
[self.navigationItem setLeftBarButtonItem:barButtonItem];

或使用此库。非常容易和美观的结果。

https://github.com/boctor/idev-recipes/tree/master/CustomBackButton

答案 1 :(得分:0)

答案 2 :(得分:-2)