用代理方法取自定义取消键还是没有效果,cancel还是cancel,并没有变成取消。没有达到理想的效果。
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
UIButton *cancelBtn = [[UIButton alloc]initWithFrame:CGRectMake(0,0,50,30)];
[cancelBtnsetTitle:@"取消" forState:(UIControlStateNormal)];
cancelBtn.backgroundColor = [UIColor redColor];
[cancelBtnaddTarget:self action:@selector(click) forControlEvents:(UIControlEventTouchUpInside)];
UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithCustomView:cancelBtn];
[viewController.navigationItem setRightBarButtonItem:btn animated:NO];
}
后来想想应该和info配置有关系,真的如愿。打开info.plist文件,找到Localization native development region这个key,修改一下Value,就可以啦!
网友评论