我现在拥有的是(uibarbuttonitem 连接到头文件中的那个)
然后我做如下定制
- (void)viewDidLoad
{
[super viewDidLoad];
UIButton *back = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 55, 32)];
[back setBackgroundImage:[UIImage imageNamed:@"back_button01.png"] forState:UIControlStateNormal];
[back setTitle:@"Back" forState:UIControlStateNormal];
[back addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside];
backButton = [[UIBarButtonItem alloc] initWithCustomView:back];
}
但是,在运行我的应用程序后,该 uibarbuttonitem 根本没有改变。我确实尝试将上面的代码放入initWithNibname
但没有运气
请指教并指出我是否在中间犯了错误