任何人请帮助我.提前致谢.
你可以在这里看到问题:
JobPostingVIEwController中的代码
@IBAction func openCreateJob(sender: AnyObject) { let vc = self.storyboard?.instantiateVIEwControllerWithIDentifIEr("CreateJobPostVIEwController") as! CreateJobPostVIEwController self.navigationController?.pushVIEwController(vc,animated: true)}
CreateJobPostVIEwController中的代码
@IBAction func addImages(sender: AnyObject) { imagePicker.allowsEditing = false imagePicker.sourceType = .Photolibrary presentVIEwController(imagePicker,animated: true,completion: nil)}func imagePickerController(picker: UIImagePickerController,dIDFinishPickingMediawithInfo info: [String : AnyObject]) { picker.dismissVIEwControllerAnimated(true,completion: nil)}func imagePickerControllerDIDCancel(picker: UIImagePickerController) { picker.dismissVIEwControllerAnimated(true,completion: nil)}解决方法@H_419_17@ 将Picker添加为子视图
尝试将imagepicker作为子视图添加到您的CreateJobPostVIEwController中,然后将其从代理中的父项中删除
@IBAction func openCreateJob(sender: AnyObject) {var picker: UIImagePickerController = UIImagePickerController()picker.delegate = selfpicker.allowsEditing = falsepicker.sourceType = .Photolibraryself.addChildVIEwController(picker)picker.dIDMovetoParentVIEwController(self)self.vIEw!.addSubvIEw(picker.vIEw!)}
然后
func imagePickerControllerDIDCancel(picker: UIImagePickerController) { picker.vIEw!.removeFromSupervIEw() picker.removeFromParentVIEwController() }
用于呈现
通过currentcontext显示选择器,例如编辑取消选择,
在演示之前使用picker.modalPresentationStyle = .overCurrentContext //
它
presentVIEwController(picker,completion: nil)总结
以上是内存溢出为你收集整理的ios – 解雇UIImagePickerController也会解散呈现视图控制器全部内容,希望文章能够帮你解决ios – 解雇UIImagePickerController也会解散呈现视图控制器所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)