图像显示在iPhone模拟器中,但不是ipad - Swift

时间:2015-07-01 23:45:33

标签: ios iphone swift parse-platform uiimageview

当我从相机胶卷中选择图像并在我的视图中显示它时,它不会出现在Ipad模拟器上。它在iPhone上很棒。这是我的代码

//--CONTROLS HOW TO PICK THE IMAGE WHEN THIS BUTTON IS CLICKED--\\
@IBAction func chooseImage(sender: AnyObject) {
    var image = UIImagePickerController()
    image.delegate = self
    image.navigationBar.tintColor = UIColor.whiteColor()
    image.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
    image.allowsEditing = false
    self.presentViewController(image, animated: true, completion: nil)
}

//--AFTER THE IMAGED IS PICKED THIS BRINGS BACK THE VIEW--\\
func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
    println("Image Selected")
    self.dismissViewControllerAnimated(true, completion: nil)
    imageToPost.image = image
    photoSelected = true
}

1 个答案:

答案 0 :(得分:0)

显然,iPad模拟器无法正确显示UIImageView imageToPost。检查故事板文件,确保图像视图正确连接到插座。

另外,请检查可能会将图像视图推离屏幕的任何约束。