WKWebView added as Subview is not resized on rotation in Swift

前端 未结 4 965
眼角桃花
眼角桃花 2021-02-04 05:41

I\'m working on adding a new reading view to my browser app. It is another view controller, that only includes a WKWebView added as a subview with a button (and gesture) to clos

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-04 06:01

    I managed to solve the problem by using this line of code:

    self._webView!.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight
    

    :)

提交回复
热议问题