ns-tabview-lazy-loading
Installation
SKILL.md
TabView lazy loading: the platform split
Android preloads 1 tab to each side of the selected tab by default; iOS cannot preload at all. The framework's own tests assert the divergence: after navigating away from and back to a page hosting a two-tab TabView, the unselected tab's content has fired loaded twice and unloaded once on Android — and zero times on iOS.
Consequences of leaving the default:
- "Fetch on tab
loaded" fetches for tabs the user never opened — on Android only. - A heavy neighbouring tab (map, webview, long list) is built during first paint of the selected tab — on Android only.
- Your loaded/unloaded counts differ per platform, so lifecycle-coupled logic drifts.
The normalizer
import { TabView } from '@nativescript/core';
tabView.androidOffscreenTabLimit = 0; // both platforms now load only the selected tab