首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PhotoLibrary未打开

PhotoLibrary未打开
EN

Stack Overflow用户
提问于 2016-10-25 13:55:49
回答 1查看 664关注 0票数 0

图片库没有打开。相机工作正常,但从照片库获取的图像却没有显示空白屏幕。昨天很好,但今天不开。请帮助任何帮助将学徒。我是Ios系统的新成员

代码语言:javascript
复制
 @IBAction func uploadImageClick (sender : UIButton){
        let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .ActionSheet)
        let deleteAction = UIAlertAction(title: "Choose From Gallery", style: .Default, handler: {
            (alert: UIAlertAction!) -> Void in
            self.picker.allowsEditing = true
            self.picker.sourceType = .PhotoLibrary
            self.presentViewController(self.picker, animated: true, completion: nil)

        })


        let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel, handler: {
            (alert: UIAlertAction!) -> Void in

        })
        optionMenu.addAction(deleteAction)

        optionMenu.addAction(cancelAction)
        self.presentViewController(optionMenu, animated: true, completion: nil)
    }
 extension NewsViewController : UIImagePickerControllerDelegate,UINavigationControllerDelegate{

    func imagePickerController(
        picker: UIImagePickerController,
        didFinishPickingMediaWithInfo info: [String : AnyObject]){
        let chosenImage = info[UIImagePickerControllerOriginalImage] as! UIImage

        dismissViewControllerAnimated(true, completion: nil)
    }
}
EN

回答 1

Stack Overflow用户

发布于 2016-10-25 15:35:08

您需要在plist中添加下面的内容

密钥是隐私-照片库使用说明 类型是字符串 价值是使用照片(这里你想要的任何东西)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40241959

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档