Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在iPad上全屏显示UIVideoEditorViewController_Ios_Swift_Uivideoeditorcontroller - Fatal编程技术网

Ios 如何在iPad上全屏显示UIVideoEditorViewController

Ios 如何在iPad上全屏显示UIVideoEditorViewController,ios,swift,uivideoeditorcontroller,Ios,Swift,Uivideoeditorcontroller,我已使用UIVideoEditorViewController修剪所选视频。问题是editorController必须在iPad中以popover风格呈现。当我在iPad上运行它时,编辑器视图会在左上角而不是全屏显示。有没有办法让popover视图全屏显示?谢谢 if UIVideoEditorController.canEditVideoAtPath(tmp) { editVideoViewController = self.storyboard?.instantiat

我已使用UIVideoEditorViewController修剪所选视频。问题是editorController必须在iPad中以popover风格呈现。当我在iPad上运行它时,编辑器视图会在左上角而不是全屏显示。有没有办法让popover视图全屏显示?谢谢

    if UIVideoEditorController.canEditVideoAtPath(tmp) {
        editVideoViewController = self.storyboard?.instantiateViewControllerWithIdentifier("editorVC") as! EditorViewController
        editVideoViewController.delegate = self
        editVideoViewController.videoPath = tmp
        editVideoViewController.videoMaximumDuration = 30
        editVideoViewController.videoQuality = .TypeHigh
        editVideoViewController.modalPresentationStyle = UIModalPresentationStyle.Popover

        editVideoViewController.popoverPresentationController?.sourceView = editVideoViewController.view

        self.presentViewController(editVideoViewController, animated: true, completion: nil)

    }

无法显示
UIVideoEditorController
全屏。你可以把它放在一些
容器
控制器中。然后使用屏幕边界配置此容器控制器
preferredContentSize
。您将获得几乎全屏大小的popover

let containerVC=UIViewController()
containerVC.preferredContentSize=UIScreen.main.bounds.size
containerVC.modalPresentationStyle=.popover
设ppc=containerVC.popoverPresentationController
ppc?.delegate=自我
ppc?.sourceView=containerVC.view
ppc?.sourceRect=UIScreen.main.bounds
ppc?.permittedArrowDirections=.init(原始值:0)
ppc?.canOverlapSourceViewRect=true
让videoController=UIVideoEditorController()
containerVC.addChild(视频控制器)
containerVC.view.addSubview(videoController.view)
videoController.didMove(主题:containerVC)
self.present(containerVC,动画:true)

如果要全屏显示,则不要设置
modalPresentationStyle
,通常显示
editVideoViewController
,它将全屏显示。我已尝试使用没有模式样式的presentViewController,但它给了我一个错误,UIVideoEditorController必须由popover呈现,而我认为您必须将其呈现为popover!!我尝试设置preferredContentSize editVideoViewController.preferredContentSize=CGSizeMake(700768),它只更改popover视图的高度。我不知道为什么它的宽度没有变化。