UIImagePickerController

UIImagePickerController

NavigationController和tabBarController下有3个UIViewControllers。

像这样推送viewControllers:A-> B-> C

在viewController C中,添加以下代码,以允许用户从照片库中选择图像。

func btnClicked() {
    let imagePickerController = UIImagePickerController()
    imagePickerController.sourceType = .photoLibrary
    imagePickerController.delegate = self
    self.present(imagePickerController, animated: true, completion: nil)
}


func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
    if let image = info[UIImagePickerControllerOriginalImage] as? UIImage{
       topIamge.image = image
    }

    picker.dismiss(animated: false, completion: nil)

}


问题是用户选择图像或取消选择之后,然后按向左箭头按钮返回B,将显示错误Unbalanced calls to begin/end appearance transitions for,如果继续返回A,则将错误再次打印出来。

我做错什么了吗?

附言如果我不显示UIImagePickerController的情况下按后退按钮,则没有错误。

谢谢。

最佳答案

我确定它与UIImagePickerController不相关
检查以下解决方案:
https://stackoverflow.com/a/12230777/6131436

https://stackoverflow.com/a/20925686/6131436

关于ios - 在NavigationController和tabBarController下使用UIImagePickerController时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45400866/

10-13 04:04