UIImagePickerController 不保存图像到 UIImageView
UIImagePickerController not saving image to UIImageView
所以我环顾四周并尝试了一些不同的东西,但我似乎仍然无法弄清楚为什么图像没有保存到 UIImageView。我已经检查并且视图控制器符合所有必要的协议,并且我已将图像选择器委托设置为自我。这是处理所选图像的代码。其他一切正常,只是在选择图像视图后没有图像发送到图像视图。
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
recipeImage.image = info[UIImagePickerControllerOriginalImage] as? UIImage
picker.dismissViewControllerAnimated(true, completion: nil)
}
像这样先关闭 imagePicker
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject])
{
picker.dismissViewControllerAnimated(true, completion: nil)
recipeImage.image = info[UIImagePickerControllerOriginalImage] as? UIImage
}
所以我环顾四周并尝试了一些不同的东西,但我似乎仍然无法弄清楚为什么图像没有保存到 UIImageView。我已经检查并且视图控制器符合所有必要的协议,并且我已将图像选择器委托设置为自我。这是处理所选图像的代码。其他一切正常,只是在选择图像视图后没有图像发送到图像视图。
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
recipeImage.image = info[UIImagePickerControllerOriginalImage] as? UIImage
picker.dismissViewControllerAnimated(true, completion: nil)
}
像这样先关闭 imagePicker
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject])
{
picker.dismissViewControllerAnimated(true, completion: nil)
recipeImage.image = info[UIImagePickerControllerOriginalImage] as? UIImage
}