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

Method initNativeView

packages/core/ui/list-view/index.ios.ts:463–482  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

461 }
462
463 initNativeView() {
464 super.initNativeView();
465 const nativeView = this.nativeViewProtected;
466 nativeView.registerClassForCellReuseIdentifier(ListViewCell.class(), this._defaultTemplate.key);
467 nativeView.registerClassForHeaderFooterViewReuseIdentifier(ListViewHeaderCell.class(), 'stickyHeader');
468 nativeView.estimatedRowHeight = DEFAULT_HEIGHT;
469 nativeView.rowHeight = UITableViewAutomaticDimension;
470 nativeView.dataSource = this._dataSource = DataSource.initWithOwner(new WeakRef(this));
471 this._delegate = UITableViewDelegateImpl.initWithOwner(new WeakRef(this));
472
473 // Control section header top padding (iOS 15+)
474 if (nativeView.respondsToSelector('setSectionHeaderTopPadding:')) {
475 if (!this.stickyHeaderTopPadding) {
476 nativeView.sectionHeaderTopPadding = 0;
477 }
478 // When stickyHeaderTopPadding is true, don't set the property to use iOS default
479 }
480
481 this._setNativeClipToBounds();
482 }
483
484 disposeNativeView() {
485 this._cleanupSearchController();

Callers

nothing calls this directly

Calls 4

classMethod · 0.65
respondsToSelectorMethod · 0.65
initWithOwnerMethod · 0.45

Tested by

no test coverage detected