1
votes

Config: xcode : 12.2 Mac Os : 10.15.7 catalina

I am trying to use wkwebview and everything works perfect in every device except all IPAD pro device. As show on below picture the resolution is not good.

Here is the code to generate the webview:

import SwiftUI
import WKView

struct ContentView: View {
    var body: some View {
        NavigationView {
            WebView(url: "https://google.com", hidesBackButton: true)
        }
    }
}

Any suggestion? ios simulator picture

1

1 Answers

0
votes

Try it...

import SwiftUI
import WebKit

struct WebView : UIViewRepresentable {

 let request: URLRequest

 func makeUIView(context: Context) -> WKWebView  {
    return WKWebView()
 }

 func updateUIView(_ uiView: WKWebView, context: Context) {
    uiView.load(request)
 }

}

Related Example SwiftUI WebView Example 2