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
self.navigationController.interactivePopGestureRecognizer.delegate = self; -(void) onBack:(id)sender { // [self dismissViewControllerAnimated:YES completion:nil]; 使用这个不行 [self.navigationController popViewControllerAnimated:YES];
/*
your selected application is navigation based application means
[self.navigationController popViewControllerAnimated:YES];
your selected application is other than the navigation based application means
[self dismissViewControllerAnimated:YES completion:nil];
*/
}
浙公网安备 33010602011771号