尝试在Utility Application
中获取自定义“完成”按钮
UIImage *back_image=[UIImage imageNamed:@"done_button.png"];
UIButton *back_button = [UIButton buttonWithType:UIButtonTypeCustom];
back_button.bounds = CGRectMake( 0, 0, back_image.size.width, back_image.size.height);
[back_button setBackgroundImage:back_image forState:UIControlStateNormal];
[back_button addTarget:self action:@selector(done) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *barButtonItem_back = [[UIBarButtonItem alloc] initWithCustomView:back_button];
self.navigationItem.leftBarButtonItem = barButtonItem_back;
self.navigationItem.hidesBackButton=YES;
[barButtonItem_back release];
UIImage *back_image=[UIImage imageNamed:@"done_button.png"];
UIButton *back_button = [UIButton buttonWithType:UIButtonTypeCustom];
back_button.bounds = CGRectMake( 0, 0, back_image.size.width, back_image.size.height);
[back_button setBackgroundImage:back_image forState:UIControlStateNormal];
[back_button addTarget:self action:@selector(done) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *barButtonItem_back = [[UIBarButtonItem alloc] initWithCustomView:back_button];
self.navigationItem.leftBarButtonItem = barButtonItem_back;
self.navigationItem.hidesBackButton=YES;
[barButtonItem_back release];
我想我无法访问这里的项目 - self.navigationItem.leftBarButtonItem = barButtonItem_back;
plz帮助 SERG
答案 0 :(得分:0)
解决!
分配按钮
navigItem.leftBarButtonItem = barButtonItem_back;