UIBarButtonItem *left = [[UIBarButtonItem alloc] initWithTitle:@"返回3" style:UIBarButtonItemStyleDone target:self action:@selector(onBack:)]; self.navigationItem.leftBarButtonItem = left; //另外自定义的按钮后 就不能使用自带的右滑返回手势,参考//http://blog.sina.com.cn/s/blog_6080da130101p6mu.html -(void) onBack:(id)sender { // [self dismissViewControllerAnimated:YES completion:nil]; 使用这个不行 [self.navigationController popViewControllerAnimated:YES]; }
时间: 2024-10-01 08:10:51