gpt4 book ai didi

ios - 如何快速将 Airprint 方向设置为横向?

转载 作者:行者123 更新时间:2023-11-28 08:30:47 34 4
gpt4 key购买 nike

我必须在横向模式下向我的 WebView 发送 Airprint。但是我在设置方向时遇到错误。我写了这段代码

    let printcontroller = UIPrintInteractionController.sharedPrintController()
let printinfo = UIPrintInfo(dictionary:nil)
printinfo.jobName = "Printing Label"
printinfo.outputType = UIPrintInfoOutputType.General
printcontroller.printInfo = printinfo
printinfo.orientation = UIDeviceOrientationLandscapeRight
printcontroller.printFormatter = myWeb.viewPrintFormatter()
printcontroller.showsNumberOfCopies = false
printcontroller.presentAnimated(true) { (_, isPrinted, error) in
if error == nil
{
if isPrinted
{
print ("Printed Successfully")
} else
{
print ("Printing failed")
}

}
}
self.performSegueWithIdentifier("finaltohome", sender: nil)

enter image description here

请帮帮我。

最佳答案

现在是枚举:UIDeviceOrientation.LandscapeLeftUIDeviceOrientation.LandscapeRight。并且您需要导入 UIKit

关于ios - 如何快速将 Airprint 方向设置为横向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38915005/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com