@@ -66,11 +66,16 @@ final class RootViewController: UIViewController {
6666 childController. didMove ( toParent: self )
6767 }
6868 childWidget = child
69-
70- NSLayoutConstraint . activate ( [
69+
70+
71+
72+ /*NSLayoutConstraint.activate([
7173 child.view.widthAnchor.constraint(equalTo: view.safeAreaLayoutGuide.widthAnchor),
7274 child.view.heightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.heightAnchor),
73- ] )
75+ ])*/
76+
77+ child. view. frame = view. bounds
78+ child. view. autoresizingMask = [ . flexibleWidth, . flexibleHeight]
7479 }
7580}
7681
@@ -108,8 +113,13 @@ extension UIKitBackend {
108113 // area insets aren't even part of the window.
109114 // If/when this is updated, ``RootViewController`` and ``WidgetProtocolHelpers`` will
110115 // also need to be updated.
111- let size = window. safeAreaLayoutGuide. layoutFrame. size
112- return SIMD2 ( Int ( size. width) , Int ( size. height) )
116+ if #available( iOS 11 , * ) {
117+ let size = window. safeAreaLayoutGuide. layoutFrame. size
118+ return SIMD2 ( Int ( size. width) , Int ( size. height) )
119+ } else {
120+ let size = window. bounds. size
121+ return SIMD2 ( Int ( size. width) , Int ( size. height) )
122+ }
113123 }
114124
115125 public func setResizeHandler(
0 commit comments