@@ -84,8 +84,6 @@ function layoutView(controller: IUILayoutViewController, owner: View): void {
84
84
const widthSpec = Utils . layout . makeMeasureSpec ( safeAreaWidth , Utils . layout . EXACTLY ) ;
85
85
const heightSpec = Utils . layout . makeMeasureSpec ( safeAreaHeight , Utils . layout . UNSPECIFIED ) ;
86
86
87
- owner . iosOverflowSafeArea = true ;
88
-
89
87
// reset _cachedFrame or it will wrongly move the view on subsequent layouts
90
88
( owner as any ) . _cachedFrame = null ;
91
89
View . measureChild ( null , owner , widthSpec , heightSpec ) ;
@@ -120,37 +118,46 @@ function layoutView(controller: IUILayoutViewController, owner: View): void {
120
118
121
119
// there are still some issues in landscape Right but they seem to come from N
122
120
123
- owner . iosIgnoreSafeArea = ! isLandscape ;
121
+ owner . iosIgnoreSafeArea = true ;
124
122
if ( controller . ignoreTopSafeArea ) {
125
- let key = 'top' ;
126
- let oppositeKey = 'bottom' ;
127
- if ( orientation === UIDeviceOrientation . LandscapeLeft ) {
128
- key = 'left' ;
129
- oppositeKey = 'right' ;
130
- } else if ( orientation === UIDeviceOrientation . LandscapeRight ) {
131
- key = 'right' ;
132
- oppositeKey = 'left' ;
133
- } else if ( orientation === UIDeviceOrientation . PortraitUpsideDown ) {
134
- key = 'bottom' ;
135
- oppositeKey = 'top' ;
136
- }
123
+ const key = 'top' ;
124
+ const oppositeKey = 'bottom' ;
125
+ // if (orientation === UIDeviceOrientation.LandscapeLeft) {
126
+ // key = 'left';
127
+ // oppositeKey = 'right';
128
+ // } else if (orientation === UIDeviceOrientation.LandscapeRight) {
129
+ // key = 'right';
130
+ // oppositeKey = 'left';
131
+ // } else if (orientation === UIDeviceOrientation.PortraitUpsideDown) {
132
+ // key = 'bottom';
133
+ // oppositeKey = 'top';
134
+ // }
137
135
const delta = safeAreaPosition [ key ] - fullscreenPosition [ key ] ;
138
136
effectiveHeight -= delta ;
139
137
adjustedPosition [ oppositeKey ] -= delta ;
140
138
adjustedPosition [ key ] -= delta ;
141
139
}
142
140
if ( controller . ignoreBottomSafeArea ) {
143
- let key = 'bottom' ;
144
- if ( orientation === UIDeviceOrientation . LandscapeLeft ) {
145
- key = 'right' ;
146
- } else if ( orientation === UIDeviceOrientation . LandscapeRight ) {
147
- key = 'left' ;
148
- } else if ( orientation === UIDeviceOrientation . PortraitUpsideDown ) {
149
- key = 'top' ;
150
- }
141
+ const key = 'bottom' ;
142
+ // if (orientation === UIDeviceOrientation.LandscapeLeft) {
143
+ // key = 'right';
144
+ // } else if (orientation === UIDeviceOrientation.LandscapeRight) {
145
+ // key = 'left';
146
+ // } else if (orientation === UIDeviceOrientation.PortraitUpsideDown) {
147
+ // key = 'top';
148
+ // }
151
149
const delta = fullscreenPosition [ key ] - safeAreaPosition [ key ] ;
152
150
effectiveHeight -= delta ;
153
151
}
152
+ if ( orientation === UIDeviceOrientation . LandscapeRight || orientation === UIDeviceOrientation . LandscapeLeft ) {
153
+ const key = 'left' ;
154
+ const oppositeKey = 'right' ;
155
+ const delta = fullscreenPosition [ key ] - safeAreaPosition [ key ] ;
156
+ adjustedPosition [ oppositeKey ] += Utils . layout . toDevicePixels ( delta ) ;
157
+ // adjustedPosition[key] += (delta);
158
+ // adjustedPosition[oppositeKey] += Utils.layout.toDevicePixels(delta);
159
+ // adjustedPosition[key] += Utils.layout.toDevicePixels(delta);
160
+ }
154
161
owner . nativeViewProtected . frame = CGRectMake (
155
162
Utils . layout . toDeviceIndependentPixels ( adjustedPosition . left ) ,
156
163
Utils . layout . toDeviceIndependentPixels ( adjustedPosition . top ) ,
@@ -253,6 +260,7 @@ class UILayoutViewController extends UIViewController {
253
260
super . viewWillLayoutSubviews ( ) ;
254
261
const owner = this . owner . get ( ) ;
255
262
if ( owner ) {
263
+ owner . iosOverflowSafeArea = true ;
256
264
IOSHelper . updateConstraints ( this , owner ) ;
257
265
}
258
266
}
0 commit comments