@@ -23,8 +23,8 @@ export class Frame extends frameCommon.Frame {
23
23
public _navigateToEntry : definition . BackstackEntry ;
24
24
public _widthMeasureSpec : number ;
25
25
public _heightMeasureSpec : number ;
26
- public _layoutWidth : number ;
27
- public _layoutheight : number ;
26
+ public _right : number ;
27
+ public _bottom : number ;
28
28
29
29
constructor ( ) {
30
30
super ( ) ;
@@ -64,7 +64,6 @@ export class Frame extends frameCommon.Frame {
64
64
65
65
backstackEntry [ NAV_DEPTH ] = navDepth ;
66
66
viewController [ ENTRY ] = backstackEntry ;
67
- this . _navigateToEntry = backstackEntry ;
68
67
69
68
this . _updateActionBar ( backstackEntry . resolvedPage ) ;
70
69
@@ -119,7 +118,6 @@ export class Frame extends frameCommon.Frame {
119
118
if ( ! this . _shouldSkipNativePop ) {
120
119
var controller = backstackEntry . resolvedPage . ios ;
121
120
var animated = this . _getIsAnimatedNavigation ( backstackEntry . entry ) ;
122
- this . _navigateToEntry = backstackEntry ;
123
121
124
122
this . _updateActionBar ( backstackEntry . resolvedPage ) ;
125
123
this . _ios . controller . popToViewControllerAnimated ( controller , animated ) ;
@@ -196,6 +194,11 @@ export class Frame extends frameCommon.Frame {
196
194
this . _heightMeasureSpec = heightMeasureSpec ;
197
195
198
196
let result = this . measurePage ( this . currentPage ) ;
197
+ if ( this . _navigateToEntry && this . currentPage ) {
198
+ let newPageSize = this . measurePage ( this . _navigateToEntry . resolvedPage ) ;
199
+ result . measuredWidth = Math . max ( result . measuredWidth , newPageSize . measuredWidth ) ;
200
+ result . measuredHeight = Math . max ( result . measuredHeight , newPageSize . measuredHeight ) ;
201
+ }
199
202
let widthAndState = view . View . resolveSizeAndState ( result . measuredWidth , width , widthMode , 0 ) ;
200
203
let heightAndState = view . View . resolveSizeAndState ( result . measuredHeight , height , heightMode , 0 ) ;
201
204
@@ -206,7 +209,7 @@ export class Frame extends frameCommon.Frame {
206
209
207
210
// If background does not span under statusbar - reduce available height.
208
211
let heightSpec : number = this . _heightMeasureSpec ;
209
- if ( page && ! page . backgroundSpanUnderStatusBar ) {
212
+ if ( page && ! page . backgroundSpanUnderStatusBar && ! this . parent ) {
210
213
let height = utils . layout . getMeasureSpecSize ( this . _heightMeasureSpec ) ;
211
214
let heightMode = utils . layout . getMeasureSpecMode ( this . _heightMeasureSpec ) ;
212
215
let statusBarHeight = uiUtils . ios . getStatusBarHeight ( ) ;
@@ -217,16 +220,19 @@ export class Frame extends frameCommon.Frame {
217
220
}
218
221
219
222
public onLayout ( left : number , top : number , right : number , bottom : number ) : void {
220
- this . _layoutWidth = right - left ;
221
- this . _layoutheight = bottom - top ;
223
+ this . _right = right ;
224
+ this . _bottom = bottom ;
222
225
this . layoutPage ( this . currentPage ) ;
226
+ if ( this . _navigateToEntry && this . currentPage ) {
227
+ this . layoutPage ( this . _navigateToEntry . resolvedPage ) ;
228
+ }
223
229
}
224
230
225
231
public layoutPage ( page : pages . Page ) : void {
226
232
// If background does not span under statusbar - reduce available height and adjust top offset.
227
- let statusBarHeight = ( page && ! page . backgroundSpanUnderStatusBar ) ? uiUtils . ios . getStatusBarHeight ( ) : 0 ;
233
+ let statusBarHeight = ( page && ! page . backgroundSpanUnderStatusBar && ! this . parent ) ? uiUtils . ios . getStatusBarHeight ( ) : 0 ;
228
234
229
- view . View . layoutChild ( this , page , 0 , statusBarHeight , this . _layoutWidth , this . _layoutheight ) ;
235
+ view . View . layoutChild ( this , page , 0 , statusBarHeight , this . _right , this . _bottom ) ;
230
236
}
231
237
232
238
public get navigationBarHeight ( ) : number {
@@ -244,6 +250,14 @@ export class Frame extends frameCommon.Frame {
244
250
245
251
super . _setNativeViewFrame ( nativeView , frame ) ;
246
252
}
253
+
254
+ public remeasureFrame ( ) : void {
255
+ this . requestLayout ( ) ;
256
+ let window : UIWindow = this . _nativeView . window ;
257
+ if ( window ) {
258
+ window . layoutIfNeeded ( ) ;
259
+ }
260
+ }
247
261
}
248
262
249
263
class UINavigationControllerImpl extends UINavigationController implements UINavigationControllerDelegate {
@@ -295,8 +309,7 @@ class UINavigationControllerImpl extends UINavigationController implements UINav
295
309
}
296
310
297
311
frame . _addView ( newPage ) ;
298
- frame . measurePage ( newPage ) ;
299
- frame . layoutPage ( newPage )
312
+ frame . remeasureFrame ( ) ;
300
313
}
301
314
else if ( newPage . parent !== frame ) {
302
315
throw new Error ( "Page is already shown on another frame." ) ;
@@ -355,9 +368,7 @@ class UINavigationControllerImpl extends UINavigationController implements UINav
355
368
356
369
frame . _navigateToEntry = null ;
357
370
frame . _currentEntry = newEntry ;
358
-
359
- frame . measurePage ( newPage ) ;
360
- frame . layoutPage ( newPage ) ;
371
+ frame . remeasureFrame ( ) ;
361
372
362
373
// In iOS we intentionally delay the raising of the 'loaded' event so both platforms behave identically.
363
374
// The loaded event must be raised AFTER the page is part of the windows hierarchy and
0 commit comments