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

Method onLayout

packages/core/ui/list-view/index.ios.ts:756–774  ·  view source on GitHub ↗
(left: number, top: number, right: number, bottom: number)

Source from the content-addressed store, hash-verified

754 }
755
756 public onLayout(left: number, top: number, right: number, bottom: number): void {
757 super.onLayout(left, top, right, bottom);
758
759 this._map.forEach((childView, listViewCell) => {
760 const rowHeight = this._effectiveRowHeight;
761 const cellHeight = rowHeight > 0 ? rowHeight : this.getHeight(childView._listViewItemIndex);
762 if (cellHeight) {
763 const width = layout.getMeasureSpecSize(this.widthMeasureSpec);
764 childView.iosOverflowSafeAreaEnabled = false;
765 View.layoutChild(this, childView, 0, 0, width, cellHeight);
766 }
767 });
768 this._headerMap.forEach((childView, listViewHeaderCell) => {
769 const headerHeight = this.stickyHeaderHeight === 'auto' ? 44 : Length.toDevicePixels(this.stickyHeaderHeight, 44);
770 const width = layout.getMeasureSpecSize(this.widthMeasureSpec);
771 childView.iosOverflowSafeAreaEnabled = false;
772 View.layoutChild(this, childView, 0, 0, width, headerHeight);
773 });
774 }
775
776 private _layoutCell(cellView: View, indexPath: NSIndexPath): number {
777 if (cellView) {

Callers

nothing calls this directly

Calls 3

getHeightMethod · 0.95
forEachMethod · 0.80
layoutChildMethod · 0.45

Tested by

no test coverage detected