MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / onLayout

Method onLayout

packages/core/ui/repeater/index.ts:180–193  ·  view source on GitHub ↗
(left: number, top: number, right: number, bottom: number)

Source from the content-addressed store, hash-verified

178 }
179
180 public onLayout(left: number, top: number, right: number, bottom: number): void {
181 const insets = this.getSafeAreaInsets();
182
183 const paddingLeft = this.effectiveBorderLeftWidth + this.effectivePaddingLeft + insets.left;
184 const paddingTop = this.effectiveBorderTopWidth + this.effectivePaddingTop + insets.top;
185 const paddingRight = this.effectiveBorderRightWidth + this.effectivePaddingRight + insets.right;
186 const paddingBottom = this.effectiveBorderBottomWidth + this.effectivePaddingBottom + insets.bottom;
187
188 const childLeft = paddingLeft;
189 const childTop = paddingTop;
190 const childRight = right - left - paddingRight;
191 const childBottom = bottom - top - paddingBottom;
192 View.layoutChild(this, this.itemsLayout, childLeft, childTop, childRight, childBottom);
193 }
194
195 public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
196 const result = View.measureChild(this, this.itemsLayout, widthMeasureSpec, heightMeasureSpec);

Callers

nothing calls this directly

Calls 2

getSafeAreaInsetsMethod · 0.80
layoutChildMethod · 0.45

Tested by

no test coverage detected