WKWebView displays content wrong after orientation change

后端 未结 4 1891
温柔的废话
温柔的废话 2020-12-30 09:43

I am fairly new to iOS development and I\'m using a WKWebView to display a page that plays a video using the Vimeo Player. When the app starts up, it shows the

4条回答
  •  时光取名叫无心
    2020-12-30 10:27

    You don't need to reload the entire web page. You just need to reload its input views. Make sure you have set constraints to web view properly and then add below code while changing orientation.

       // Reload inputs so that webview can adjust its content according to orientation
         [self.webView reloadInputViews];
    

提交回复
热议问题