3***@qq.com
3***@qq.com
  • 发布:2023-11-24 11:27
  • 更新:2023-11-26 14:27
  • 阅读:124

ipad 15长按会出现放大镜

分类:uni-app

PC开发环境操作系统: MacOS

开发环境操作系统版本号: monterey 12.1

HBuilderX类型: Alpha HBuilderX

版本号: 3.96

手机系统: iPadOS系统

版本号:iPadOS 15

手机厂商: 苹果手机

机型: iPad Air

页面类型: vue

版本:

vue2打包方式: 云端项目创建方式: HBuilderX

2023-11-24 11:27 负责人:无 分享
已邀请:
3***@qq.com

3***@qq.com (作者)

解决办法 放弃uniapp 打包 app 改为打包 h5

使用原生套壳展示

class ViewController: UIViewController {

lazy var webView = {  
    let scriptString = "document.documentElement.style.webkitUserSelect='none';"  
    let userScript = WKUserScript(source: scriptString, injectionTime: .atDocumentEnd, forMainFrameOnly: true)  
    let contentController = WKUserContentController()  
    contentController.addUserScript(userScript)  
    let configuration = WKWebViewConfiguration()  
    configuration.userContentController = contentController  
    let web = WKWebView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height),configuration: configuration)       
    return web  
}();  

override func viewDidLoad() {  
    super.viewDidLoad()  
    webView.uiDelegate = self;  
    webView.navigationDelegate = self;  
    self.view.addSubview(webView);  
    if let htmlFileURL = Bundle.main.url(forResource: "index", withExtension: "html", subdirectory: "h5") {  
        let absoluteURL = htmlFileURL.absoluteURL  
        webView.loadFileURL(absoluteURL, allowingReadAccessTo: absoluteURL.deletingLastPathComponent())  
    }  
    // Do any additional setup after loading the view.  
}     

}
修改打包配置 参考 https://blog.csdn.net/YourPasser/article/details/134039943

要回复问题请先登录注册