简体   繁体   中英

IOS Swift - UIWebView jump to anchor tag

I am loading a local html file and would like to jump to an anchor tag somewhere on the page. I am using this code to load the file:

        let documentDirectoryURL = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
        let fileDestinationUrl = documentDirectoryURL.appendingPathComponent("page.html")
        let request = URLRequest(url: fileDestinationUrl)
        webView.loadRequest(request)

Is there away to jump to an anchor tag on this page

我刚刚确认,将其操作系统更新为相同版本的模拟器iOS 10.3后,它们也可以在iPhone6中使用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM