0

When I load web view it is covering the entire screen

it is not displaying the navigation bar using a

navigation controller

How to display a web view with navigation bar using a navigation

controller without covering the whole screen

Chatter Webview:

@IBOutlet var chatterWebView: WKWebView?

Loading WebView :

 let webConfiguration = WKWebViewConfiguration()

chatterWebView = WKWebView(frame: .zero, configuration: webConfiguration)

chatterWebView!.uiDelegate = self

 view = chatterWebView

URL Request :

chatterWebView!.load(request as URLRequest)

Navigation bar:

self.navigationController?.navigationBar.isHidden = false

https://i.stack.imgur.com/ZjSye.png

this is the image which is populating, covering the entire screen. It should fit the view controller

I have given the constraints also

AjinkyaSharma
  • 1,870
  • 1
  • 16
  • 26
  • set the leading, trailing, top and bottom constraints of Web view from Safe Area. – Rahuld Oct 09 '19 at 05:39
  • I have set the constraints on that but I have figured out the solution through code let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil) let nextViewController = storyBoard.instantiateViewController(withIdentifier: "identifier1") as!Controller let vc = UINavigationController(rootViewController: nextViewController) self.present(vc, animated:true, completion:nil) – Pravallika Damerla Oct 10 '19 at 06:17

0 Answers0