如何修复将QLPreviewController添加为子视图

时间:2019-04-30 22:13:27

标签: ios swift frame qlpreviewcontroller

PDF加载到QLPreviewController中时,它不适合我内部的内容,我将其作为子视图添加到容器视图中。 PDF的缩放比要求的更大。有什么方法可以修改QLPreview的缩放比例?

let preview = QLPreviewController()
    preview.dataSource = self
    preview.navigationController?.isNavigationBarHidden = true
    addChild(preview)
    termsConditionsContainer.addSubview(preview.view)
    termsConditionsContainer.backgroundColor = .white
    preview.view.translatesAutoresizingMaskIntoConstraints = false
    preview.view.topAnchor.constraint(equalTo: termsConditionsContainer.topAnchor).isActive = true
    preview.view.leftAnchor.constraint(equalTo: self.termsConditionsContainer.leftAnchor).isActive = true
    preview.view.widthAnchor.constraint(equalTo: self.termsConditionsContainer.widthAnchor).isActive = true
    preview.view.bottomAnchor.constraint(equalTo: termsConditionsContainer.bottomAnchor).isActive = true
    preview.didMove(toParent: self)

0 个答案:

没有答案