“Creating an image format with an unknown type is an error” with UIImagePickerController

后端 未结 23 1873
长发绾君心
长发绾君心 2020-11-28 09:08

While choosing an image from the image picker in iOS 10 Swift 3 I am getting an error - Creating an image format with an unknown type is an error



        
23条回答
  •  青春惊慌失措
    2020-11-28 09:32

    If this helps anyone, I had this happen when I subclassed UIImageView to create a rounded view. It also happened when I added the below line in viewDidLoad()

    imageView.layer.cornerRadius = self.imageView.frame.size.width / 2
    

    I ended up adding the line in viewWillLayoutSubViews and it worked. See this for more details:

    clipsToBounds causes UIImage to not display in iOS10 & XCode 8

提交回复
热议问题