MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / onMeasure

Method onMeasure

packages/core/ui/page/index.ios.ts:484–507  ·  view source on GitHub ↗
(widthMeasureSpec: number, heightMeasureSpec: number)

Source from the content-addressed store, hash-verified

482 }
483
484 public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number) {
485 const width = layout.getMeasureSpecSize(widthMeasureSpec);
486 const widthMode = layout.getMeasureSpecMode(widthMeasureSpec);
487
488 const height = layout.getMeasureSpecSize(heightMeasureSpec);
489 const heightMode = layout.getMeasureSpecMode(heightMeasureSpec);
490
491 if (this.hasActionBar && this.frame && this.frame._getNavBarVisible(this)) {
492 const { width, height } = this.actionBar._getActualSize;
493 const widthSpec = layout.makeMeasureSpec(width, layout.EXACTLY);
494 const heightSpec = layout.makeMeasureSpec(height, layout.EXACTLY);
495 View.measureChild(this, this.actionBar, widthSpec, heightSpec);
496 }
497
498 const result = View.measureChild(this, this.layoutView, widthMeasureSpec, heightMeasureSpec);
499
500 const measureWidth = Math.max(result.measuredWidth, this.effectiveMinWidth);
501 const measureHeight = Math.max(result.measuredHeight, this.effectiveMinHeight);
502
503 const widthAndState = View.resolveSizeAndState(measureWidth, width, widthMode, 0);
504 const heightAndState = View.resolveSizeAndState(measureHeight, height, heightMode, 0);
505
506 this.setMeasuredDimension(widthAndState, heightAndState);
507 }
508
509 public onLayout(left: number, top: number, right: number, bottom: number) {
510 if (this.hasActionBar) {

Callers

nothing calls this directly

Calls 4

setMeasuredDimensionMethod · 0.80
_getNavBarVisibleMethod · 0.45
measureChildMethod · 0.45
resolveSizeAndStateMethod · 0.45

Tested by

no test coverage detected