我有一个 UIImagePickerController 在 iOS 7 的 UIPopoverController 中作为模式呈现。当它呈现时,我看不到任何取消按钮。我试图将 leftBarItem 插入其导航栏中:
picker.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(dismissModalViewControllerAnimated:)];
但它不起作用。
这是我展示选择器的方式:
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
[picker.navigationBar setTranslucent:NO];
[picker.navigationBar setBarStyle:UIBarStyleBlackOpaque];
[picker.navigationBar setBarTintColor:barGray];
}else{
[picker.navigationController.navigationBar setTintColor:barGray];
}
[self presentViewController:picker animated:YES completion:^{
//I also tried to put the leftBarItem setting code here. Doesn't work either.
}];
有人有什么想法吗?