# What is NativeScript? [​](https://docs.nativescript.org/\#what-is-nativescript) NativeScript provides platform APIs directly to the JavaScript runtime ( _with strong types_) for a rich TypeScript development experience. Some popular use cases: - Building Web, iOS, Android and Vision Pro apps with a shared codebase (aka, cross platform apps) - Building native platform apps with portable JavaScript skills - Augmenting JavaScript projects with platform API capabilities - AndroidTV and Watch development - watchOS development - Learning native platforms through JavaScript understanding - Exploring platform API documentation by trying APIs [directly from a web browser](https://preview.nativescript.org/) without requiring a platform development machine setup. ### Why NativeScript? [​](https://docs.nativescript.org/\#why-nativescript) - JavaScript skill reuse - Natural platform feel and performance characteristics - Improve how Platform developers can work together with JavaScript developers - Strengthening job market potential by allowing developers to port their skills between different environments - Fully open source and a member of [OpenJS Foundation](https://openjsf.org/), supporting the healthy growth of JavaScript and web technologies by providing a neutral organization to host and sustain projects, as well as collaboratively fund activities that benefit the ecosystem as a whole This is all facilitated by the supported platform runtimes: - [@nativescript/android](https://docs.nativescript.org/guide/extending-classes-and-implementing-interfaces-android) - [@nativescript/ios](https://docs.nativescript.org/guide/extending-classes-and-conforming-to-protocols-ios) - [@nativescript/visionos](https://docs.nativescript.org/guide/visionos) To aid in cross-platform development, common use cases are implemented in [@nativescript/core](https://docs.nativescript.org/core) utilizing the underlying native APIs provided by each runtime. Many popular JavaScript frameworks can be used; often referred to as _flavors_, for example: - Plain JavaScript or TypeScript—currently part of `@nativescript/core`, uses XML to declare the UI and JavaScript classes for data binding - Angular via `@nativescript/angular` - Vue via `nativescript-vue` - React via `react-nativescript` - Solid via `@nativescript-community/solid-js` - Svelte via `@nativescript-community/svelte-native` There's more! Given how NativeScript is built, new flavors can be implemented on top of it anytime. A few more great examples from the community: - [rEFui](https://github.com/SudoMaker/rEFui#native) - and [more with DOMiNATIVE](https://github.com/SudoMaker/dominative) ## Ready to dive in? [​](https://docs.nativescript.org/\#ready-to-dive-in) You will want to setup your development machine using the [Environment Setup guide](https://docs.nativescript.org/setup/) which involves preparing your machine for iOS and Android development as well as installing the [NativeScript CLI](https://www.npmjs.com/package/nativescript) via `npm install -g nativescript` Next [Environment Setup→](https://docs.nativescript.org/setup/) 2. [What is NativeScript?](https://docs.nativescript.org/#what-is-nativescript) 1. [Why NativeScript?](https://docs.nativescript.org/#why-nativescript) 3. [How to use the docs?](https://docs.nativescript.org/#how-to-use-the-docs) 4. [Ready to dive in?](https://docs.nativescript.org/#ready-to-dive-in) ## NativeScript Snacks Each Snack reveals NativeScript's power, from UI tricks to platform SDK usages to flavor implementations all through [StackBlitz](https://stackblitz.com/). Get a peek 👀 at what's possible. ## Explore Snacks [​](https://docs.nativescript.org/snacks/\#explore-snacks) ### Spaceman using just TypeScript [Spaceman using just TypeScript](https://www.youtube.com/watch?v=hHqlEbU8o2o) [Shared Elements](https://docs.nativescript.org/guide/shared-element-transitions) [TypeScript](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-plain-typescript) Shared Element Transitions using TypeScript. [View on StackBlitz](https://stackblitz.com/edit/nativescript-spaceman-transition-example?file=app%2Fspace-view.xml) [Spaceman using just TypeScript](https://www.youtube.com/watch?v=hHqlEbU8o2o) [Shared Elements](https://docs.nativescript.org/guide/shared-element-transitions) [Vue](https://nativescript-vue.org/) ### Spaceman using just Vue 3 Shared Element Transitions using Vue 3. [View on StackBlitz](https://stackblitz.com/edit/nativescript-vue3-spaceman-transition-example?file=app%2Fcomponents%2FSpaceView.vue) ### Music Player UI [Music Player UI](https://www.youtube.com/watch?v=KatL9m7E2XI) [Shared Elements](https://docs.nativescript.org/guide/shared-element-transitions) [TypeScript](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-plain-typescript) Music Player UI with Shared Element Transitions. [View on StackBlitz](https://stackblitz.com/edit/nativescript-music-player-transition-example?file=app%2Fmain-view.xml) ### Reflective UI [NativeScript Reflective UI](https://www.youtube.com/watch?v=rbF6mYfwnck) [iOS AVCaptureSession](https://developer.apple.com/documentation/avfoundation/avcapturesession?language=objc) Using iOS AVCaptureSession to create live reflective UI mask. Try with your phone in Dark Mode, it's neat! [View on StackBlitz](https://stackblitz.com/edit/nativescript-reflective-ui?file=src%2Fapp%2Fitem%2Fitems.component.ts) ### Day Night Switch [Custom NativeScript Day/Night Switch](https://www.youtube.com/watch?v=8kb7ObVOJIg) [Angular](https://angular.dev/) [React](https://react.dev/) [Solid](https://www.solidjs.com/) [Svelte](https://svelte.dev/) [Vue](https://vuejs.org/) Custom NativeScript Day/Night Switch. [Angular on StackBlitz](https://stackblitz.com/edit/nativescript-daynightswitch-angular?file=src%2Fapp%2Fexample.component.html) [React on StackBlitz](https://stackblitz.com/edit/nativescript-daynightswitch-react?file=src%2Fcomponents%2FHome.tsx) [Solid on StackBlitz](https://stackblitz.com/edit/nativescript-daynightswitch-solid?file=src%2Fcomponents%2Fhome.tsx) [Svelte on StackBlitz](https://stackblitz.com/edit/nativescript-daynightswitch-svelte?file=src%2Fcomponents%2FHome.svelte) [Vue on StackBlitz](https://stackblitz.com/edit/nativescript-daynightswitch-vue?file=src%2Fcomponents%2FHome.vue) ### Tetris Game with Vue 3 [Tetris Game with Vue 3](https://www.youtube.com/watch?v=To_bycK6BGY) [Vue](https://nativescript-vue.org/) Tetris Game with Vue 3. [View on StackBlitz](https://stackblitz.com/edit/ns-tetris?file=src%2Fcomponents%2FHome.vue) [iOS Recognize Text from an Image](https://www.youtube.com/watch?v=cCqqXezvfWs) [Angular](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-angular) [iOS Vision Framework](https://developer.apple.com/documentation/vision?language=objc) ### iOS Recognize Text from an Image Recognizing text from an Image on iOS. [View on StackBlitz](https://stackblitz.com/edit/nativescript-text-from-image?file=src%2Fapp%2Fhome%2Fhome.component.ts) ### iOS PDFKit [iOS PDFKit](https://www.youtube.com/watch?v=ucmAXFaFbY0) [Angular](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-angular) [iOS PDFKit](https://developer.apple.com/documentation/pdfkit?language=objc) Generating and previewing PDFs using iOS PDFKit. [View on StackBlitz](https://stackblitz.com/edit/nativescript-pdfview-via-ios-pdfkit?file=src%2Fapp%2Fnative-pdfview%2Fnative-pdfview.ts) ### PDF w/ WKWebView & AndroidPdfViewer [Angular](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-angular) [iOS WKWebView](https://developer.apple.com/documentation/webkit/wkwebview) [Gradle AndroidPdfViewer](https://github.com/barteksc/AndroidPdfViewer) Rendering PDF with WKWebView on iOS. [View on StackBlitz](https://stackblitz.com/edit/nativescript-pdfviewer?file=src%2Fapp%2Fnative-pdfview%2Findex.ios.ts) [Angular](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-angular) [TextView](https://docs.nativescript.org/ui/text-view) ### Autogrow Textfield Autogrowing Textfield as you type. [View on StackBlitz](https://stackblitz.com/edit/nativescript-ng-textview-autogrow-vs-textfield?file=src%2Fapp%2Fitem%2Fitems.component.html) ### Text to Speech [Android TextToSpeech](https://developer.android.com/reference/android/speech/tts/TextToSpeech) [iOS AVSpeechUtterance](https://developer.apple.com/documentation/avfaudio/avspeechutterance?language=objc) Simple Text to Speech. [View on StackBlitz](https://stackblitz.com/edit/nativescript-text-to-speech?file=src%2Fapp%2Fspeech%2Findex.ios.ts) ### Battery Level Check [Android Battery Monitoring](https://developer.android.com/training/monitoring-device-state/battery-monitoring) [iOS UIDevice](https://developer.apple.com/documentation/uikit/uidevice?language=objc) Getting the current battery level. [View on StackBlitz](https://stackblitz.com/edit/nativescript-battery-level-check?file=app%2Fbattery%2Findex.ios.ts) ### Toggle Device Light [Android CameraManager](https://developer.android.com/reference/android/hardware/camera2/CameraManager) [iOS AVCaptureDevice](https://developer.apple.com/documentation/avfoundation/avcapturedevice?language=objc) Toggling the Device Light on and off. [View on StackBlitz](https://stackblitz.com/edit/nativescript-torch?file=src%2Fapp%2Ftorch%2Findex.ios.ts) ### Using local image assets [Image](https://docs.nativescript.org/ui/image) Using local image assets. [View on StackBlitz](https://stackblitz.com/edit/nativescript-local-image-asset?file=package.json,src%2Fapp%2Fitem%2Fitems.component.html) ### Checkbox [CheckBox](https://github.com/nstudio/nativescript-plugins/blob/main/packages/nativescript-checkbox/README.md) Using checkbox components. [View on StackBlitz](https://stackblitz.com/edit/nativescript-checkbox-example?file=src%2Fapp%2Fitem%2Fitems.component.html) ### Dropdown Menus [NativeScript Dropdown Menus](https://www.youtube.com/watch?v=0zE5OjiJTk8) [iOS UIMenu](https://developer.apple.com/documentation/uikit/uimenu) [Android PopupMenu](https://developer.android.com/reference/android/widget/PopupMenu) Using dropdown menus. [View on StackBlitz](https://stackblitz.com/edit/nativescript-dropdown-menus?file=src%2Fapp%2Fmenu-button%2Findex.ios.ts) ### Large Title Display on iOS [Enable large title displays for iOS Navigation from NativeScript's Frame.](https://www.youtube.com/watch?v=bwgVIZSpZ00) [iOS prefersLargeTitles](https://developer.apple.com/documentation/uikit/uinavigationbar/2908999-preferslargetitles?language=objc) How to enable large title displays for iOS navigation with NativeScript using prefersLargeTitles property of UINavigationBar, accessible from every Frame. [View on StackBlitz](https://stackblitz.com/edit/nativescript-ios-large-titles-angular?file=src%2Fapp%2Fitem%2Fitems.component.ts) ### Hardware device volume [Adjusting hardware device volume with NativeScript](https://www.youtube.com/watch?v=1DR_9AZrMe4) [iOS outputVolume](https://developer.apple.com/documentation/avfaudio/avaudiosession/1616533-outputvolume?language=objc) [Android getStreamVolume](https://developer.android.com/reference/android/media/AudioManager#getStreamVolume(int)) [Vue](https://nativescript-vue.org/) How to get the current device volume using NativeScript on iOS and Android. [View on StackBlitz](https://stackblitz.com/edit/nativescript-device-volume?file=src%2Futils%2Fvolume.ts) ### Top Bar Height [Top Bar Height with NativeScript](https://www.youtube.com/watch?v=bXSyBTGJIlc) [iOS statusBarManager](https://developer.apple.com/documentation/uikit/uiwindowscene/3213943-statusbarmanager?language=objc) [iOS UINavigationBar](https://developer.apple.com/documentation/uikit/uinavigationbar?language=objc) [Android Resources](https://developer.android.com/guide/topics/resources/providing-resources) [Android bar height id](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/dimens_material.xml#39) How to check the top bar height with NativeScript on iOS and Android. [View on StackBlitz](https://stackblitz.com/edit/nativescript-topbar-height?file=src%2Fapp%2Futils%2Fdevice.ts) ### iOS Spotlight Search [Use iOS Spotlight Search with NativeScript](https://www.youtube.com/watch?v=uzzMskFL5g8) [iOS Core Spotlight](https://developer.apple.com/documentation/corespotlight) How to allow app content to be searchable using iOS Core Spotlight. [View on StackBlitz](https://stackblitz.com/edit/nativescript-ios-spotlight-search?file=src%2Fapp%2Fitem%2Fitem.service.ts) ### Improve UX with NativeScript TouchManager [Instantly improve UX with NativeScript's TouchManager](https://www.youtube.com/watch?v=vAyGyuNFCbk) [TouchManager](https://docs.nativescript.org/guide/animations#touchmanager-8-2) Instantly improve UX with NativeScript's TouchManager. [View on StackBlitz](https://stackblitz.com/edit/nativescript-touchmanager?file=src%2Fapp%2Futils.ts) ### Tab Navigation with iOS and Android [NativeScript Tab Navigation with Juicy Choices](https://www.youtube.com/watch?v=-FPEdFE1XeM) [Angular](https://angular.dev/) Example of how to configure tab navigation with lots of options. [View on StackBlitz](https://stackblitz.com/edit/nativescript-tab-nav-ng?file=src%2Fapp%2Ffeatures%2Fhome%2Fcomponents%2Fhome.component.html) ### Screen Snapshot [Screen Snapshot](https://www.youtube.com/watch?v=ORp4y2tbJUA) [iOS CALayer render](https://developer.apple.com/documentation/quartzcore/calayer/render(in:)) [Android createBitmap](https://developer.android.com/reference/android/graphics/Bitmap#createBitmap(android.graphics.Bitmap,%20int,%20int,%20int,%20int)) Example of how to take a snapshot of any view on screen. [View on StackBlitz](https://stackblitz.com/edit/nativescript-screen-snapshot?file=src%2Fhome.component.html) ### Solid NativeScript Vibes [Solid NativeScript Vibes](https://www.youtube.com/watch?v=FLxZ_T5yN_A) [iOS AVAudioPlayer](https://developer.apple.com/documentation/avfaudio/avaudioplayer/averagepower(forchannel:)?language=objc) [Android Visualizer](https://developer.android.com/reference/android/media/audiofx/Visualizer) [Solid](https://www.solidjs.com/) Example of using audio player with metering. [View on StackBlitz](https://stackblitz.com/edit/nativescript-solid-vibes?file=src%2Fcomponents%2Fhome.tsx) ### CollectionView Layout Playground [CollectionView Layout Playground](https://www.youtube.com/watch?v=SfYRtBiTXiM) [@nativescript-community/ui-collectionview](https://github.com/nativescript-community/ui-collectionview) Example of using CollectionView with different layout options. [View on StackBlitz](https://stackblitz.com/edit/nativescript-collectionview-layout-playground?file=src%2Fapp%2Fitem%2Fitem-columns.component.html) 2. [Explore Snacks](https://docs.nativescript.org/snacks/#explore-snacks) ## NativeScript Tutorials NativeScript is a celebration of the platform in your favorite language, **JavaScript**. Along with that comes all the benefits you might expect, like being able to use your favorite JavaScript framework. | Name | Type | Difficulty | | --- | --- | --- | | [Build a master-detail app with Plain TypeScript](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-plain-typescript) | Tutorial | Beginner | | [Build a master-detail app with Plain JavaScript](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-plain-javascript) | Tutorial | Beginner | | [Build a master-detail app with Angular](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-angular) | Tutorial | Beginner | | [Build a master-detail app with Vue](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-vue) | Tutorial | Beginner | | [Build a master-detail app with React](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-react) | Tutorial | Beginner | | [Build a master-detail app with Svelte](https://docs.nativescript.org/tutorials/build-a-master-detail-app-with-svelte) | Tutorial | Beginner | | [Create a NativeScript plugin Part 1: Label Marquee](https://blog.nativescript.org/create-a-custom-view-plugin-marquee-label) | Blog/Tutorial | Intermediate | | [Create a NativeScript plugin Part 2: Shimmer](https://blog.nativescript.org/create-a-custom-view-plugin-shimmer) | Blog/Tutorial | Intermediate | | [Create a NativeScript plugin Part 3: Touch Effects](https://blog.nativescript.org/create-a-custom-view-plugin-touch-effects) | Blog/Tutorial | Intermediate | | [Develop Vision Pro 🥽 apps with TypeScript](https://blog.nativescript.org/develop-visionos-apps-with-typescript) | Blog/Tutorial | Advanced | | [Develop Vision Pro 🥽 apps with Angular](https://blog.nativescript.org/develop-visionos-apps-with-angular) | Blog/Tutorial | Advanced | | [Develop Vision Pro 🥽 apps with React](https://blog.nativescript.org/develop-visionos-apps-with-react) | Blog/Tutorial | Advanced | | [Develop Vision Pro 🥽 apps with Solid](https://blog.nativescript.org/develop-visionos-apps-with-solid) | Blog/Tutorial | Advanced | | [Develop Vision Pro 🥽 apps with Svelte](https://blog.nativescript.org/develop-visionos-apps-with-svelte) | Blog/Tutorial | Advanced | | [Develop Vision Pro 🥽 apps with Vue](https://blog.nativescript.org/develop-visionos-apps-with-vue) | Blog/Tutorial | Advanced | ## NativeScript Core Documentation ## @nativescript/core [​](https://docs.nativescript.org/core/\#nativescript-core) - [Application](https://docs.nativescript.org/core/application) - [ApplicationSettings](https://docs.nativescript.org/core/application-settings) - [Color](https://docs.nativescript.org/core/color) - [Connectivity](https://docs.nativescript.org/core/connectivity) - [Device](https://docs.nativescript.org/core/device) - [FileSystem](https://docs.nativescript.org/core/file-system) - [FPS Meter](https://docs.nativescript.org/core/fps-meter) - [Http](https://docs.nativescript.org/core/http) - [ImageCache](https://docs.nativescript.org/core/image-cache) - [Observable](https://docs.nativescript.org/core/observable) - [Screen](https://docs.nativescript.org/core/screen) - [Trace](https://docs.nativescript.org/core/tracing) - [Utils](https://docs.nativescript.org/core/utils) - [XmlParser](https://docs.nativescript.org/core/xml-parser) See also [API Reference](https://docs.nativescript.org/api/). 2. [@nativescript/core](https://docs.nativescript.org/core/#nativescript-core) ## NativeScript Plugins Guide ## @nativescript/\* plugins [​](https://docs.nativescript.org/plugins/\#nativescript-plugins) Many plugins offered by NativeScript's Technical Steering Committee (TSC) are listed in the sidebar/sub navigation to help with your developments. For example, everything from [biometrics](https://docs.nativescript.org/plugins/biometrics), [camera](https://docs.nativescript.org/plugins/camera) handling, [contacts](https://docs.nativescript.org/plugins/contacts) management, [Firebase](https://docs.nativescript.org/plugins/firebase-core) integration, [Google Maps](https://docs.nativescript.org/plugins/google-maps), to payment management using [Apple Pay](https://docs.nativescript.org/plugins/apple-pay), [Google Pay](https://docs.nativescript.org/plugins/google-pay), or [IAP and Subscription handling](https://docs.nativescript.org/plugins/payments) and many more can be found here. ## Developing your own plugins [​](https://docs.nativescript.org/plugins/\#developing-your-own-plugins) If you are interested in building your own plugins, we recommend following our [Getting Started with Plugin Workspaces](https://docs.nativescript.org/plugins/plugin-workspace-guide) guide which uses our [plugin workspace seed](https://github.com/NativeScript/plugin-seed) ( _the exact same setup the TSC uses to develop it's own plugins_) as a starting point because it provides the following: - consistent plugin source structure - ability to scale and add additional plugins through automated tooling - reduces configuration files to provide easy maintainence - provides shareable structure for ease of demoing your plugins - ability to focus your workspace down to a single plugin in an instant if you ever need to isolate development when working within a multi-plugin workspace - provides automated migrations managed by the TSC to keep your plugin workspaces up-to-date without manual hassles You may also find these resources helpful: - [Introducing plugin workspaces to simplify and streamline maintenance](https://blog.nativescript.org/announcing-plugin-workspaces) - [Migrate your plugin workspace in 2 seconds - NativeScript 8 + webpack5 + configuration updates](https://blog.nativescript.org/plugin-workspace-migrate-to-v2) ### Creating NativeScript Plugins and Enhancing Behavior [​](https://docs.nativescript.org/plugins/\#creating-nativescript-plugins-and-enhancing-behavior) - [Part 1: How to create a NativeScript plugin that uses native iOS & Android views - Label Marquee!](https://blog.nativescript.org/create-a-custom-view-plugin-marquee-label) - [Part 2: How to create a NativeScript plugin that uses native iOS & Android views - more native platform APIs - Shimmer!](https://blog.nativescript.org/create-a-custom-view-plugin-shimmer) - [Part 3: Should this be a plugin or part of core? 💥 Holy Interactivity Batman!](https://blog.nativescript.org/create-a-custom-view-plugin-touch-effects) 2. [@nativescript/\* plugins](https://docs.nativescript.org/plugins/#nativescript-plugins) 3. [Developing your own plugins](https://docs.nativescript.org/plugins/#developing-your-own-plugins) 1. [Creating NativeScript Plugins and Enhancing Behavior](https://docs.nativescript.org/plugins/#creating-nativescript-plugins-and-enhancing-behavior) ## NativeScript Setup Guide ## Try it online [​](https://docs.nativescript.org/setup/\#try-it-online) You can play with NativeScript online directly on StackBlitz, or locally using [NativeScript Preview](https://preview.nativescript.org/). - [NativeScript TypeScript](https://nativescript.new/) - [NativeScript JavaScript](https://nativescript.new/js) - [NativeScript Angular](https://nativescript.new/angular) - [NativeScript Vue 2](https://nativescript.new/vue) - [NativeScript Vue 3](https://nativescript.new/vue3) - [NativeScript React](https://nativescript.new/react) - [NativeScript Svelte](https://nativescript.new/svelte) ## Local setup [​](https://docs.nativescript.org/setup/\#local-setup) Select the guide relevant to your development machine and follow the steps carefully to get a clean working environment ready. | Operating System | Android | iOS | | --- | --- | --- | | Windows | ✅ [Setup Guide](https://docs.nativescript.org/setup/windows) | ❌ Unsupported | | macOS | ✅ [Setup Guide](https://docs.nativescript.org/setup/macos) | ✅ [Setup Guide](https://docs.nativescript.org/setup/macos#setting-up-macos-for-ios) | | Linux | ✅ [Setup Guide](https://docs.nativescript.org/setup/linux) | ❌ Unsupported | A note about iOS on unsupported systems A Mac is required to build projects that use native iOS code. Simpler apps can be tested using [NativeScript Preview](https://preview.nativescript.org/). 2. [Try it online](https://docs.nativescript.org/setup/#try-it-online) 3. [Local setup](https://docs.nativescript.org/setup/#local-setup)≈ ## NativeScript UI Components ## Layout Containers [​](https://docs.nativescript.org/ui/\#layout-containers) - [StackLayout](https://docs.nativescript.org/ui/stack-layout) - [GridLayout](https://docs.nativescript.org/ui/grid-layout) - [RootLayout](https://docs.nativescript.org/ui/root-layout) - [FlexboxLayout](https://docs.nativescript.org/ui/flexbox-layout) - [WrapLayout](https://docs.nativescript.org/ui/wrap-layout) - [DockLayout](https://docs.nativescript.org/ui/dock-layout) - [AbsoluteLayout](https://docs.nativescript.org/ui/absolute-layout) ## Navigation Components [​](https://docs.nativescript.org/ui/\#navigation-components) - [Frame](https://docs.nativescript.org/ui/frame) - [Page](https://docs.nativescript.org/ui/page) - [ActionBar](https://docs.nativescript.org/ui/action-bar) - [ActionItem](https://docs.nativescript.org/ui/action-bar#action-item) - [NavigationButton](https://docs.nativescript.org/ui/action-bar#navigation-button) ## Dialogs [​](https://docs.nativescript.org/ui/\#dialogs) - [Alert](https://docs.nativescript.org/ui/dialogs#alert) - [Action](https://docs.nativescript.org/ui/dialogs#action) - [Confirm](https://docs.nativescript.org/ui/dialogs#confirm) - [Prompt](https://docs.nativescript.org/ui/dialogs#prompt) - [Login](https://docs.nativescript.org/ui/dialogs#login) ## Components [​](https://docs.nativescript.org/ui/\#components) - [ActivityIndicator](https://docs.nativescript.org/ui/activity-indicator) - [Button](https://docs.nativescript.org/ui/button) - [DatePicker](https://docs.nativescript.org/ui/date-picker) - [HtmlView](https://docs.nativescript.org/ui/html-view) - [Image](https://docs.nativescript.org/ui/image) - [Label](https://docs.nativescript.org/ui/label) - [ListPicker](https://docs.nativescript.org/ui/list-picker) - [ListView](https://docs.nativescript.org/ui/list-view) - [Placeholder](https://docs.nativescript.org/ui/placeholder) - [Progress](https://docs.nativescript.org/ui/progress) - [ScrollView](https://docs.nativescript.org/ui/scroll-view) - [SearchBar](https://docs.nativescript.org/ui/search-bar) - [SegmentedBar](https://docs.nativescript.org/ui/segmented-bar) - [Slider](https://docs.nativescript.org/ui/slider) - [Switch](https://docs.nativescript.org/ui/switch) - [TabView](https://docs.nativescript.org/ui/tab-view) - [TextField](https://docs.nativescript.org/ui/text-field) - [TextView](https://docs.nativescript.org/ui/text-view) - [TimePicker](https://docs.nativescript.org/ui/time-picker) - [WebView](https://docs.nativescript.org/ui/web-view) 2. [Layout Containers](https://docs.nativescript.org/ui/#layout-containers) 3. [Navigation Components](https://docs.nativescript.org/ui/#navigation-components) 4. [Dialogs](https://docs.nativescript.org/ui/#dialogs) 5. [Components](https://docs.nativescript.org/ui/#components) ## NativeScript Page Component `` is a UI component for representing screens that users are able to navigate to through a [Frame](https://docs.nativescript.org/ui/frame). A Page itself can only contain a single child view with the exception of the [ActionBar](https://docs.nativescript.org/ui/action-bar) which has it's own special "slot". ![](https://docs.nativescript.org/assets/ActionBar.14a4cad9.png) ![](https://docs.nativescript.org/assets/ActionBar.b88bf667.png) ```xml ``` ## Page Lifecycle [​](https://docs.nativescript.org/ui/page\#page-lifecycle) A page emits various events during navigation that you can use to update data/state in your app. ![Frame and Page lifecycle](https://docs.nativescript.org/assets/Frame_Page_Lifecycle.drawio.6c5d01fb.svg) ### Lifecycle event examples [​](https://docs.nativescript.org/ui/page\#lifecycle-event-examples) Navigating forward and back ```bash # frame.navigate(mainPage) - initial navigation mainPage > navigatingTo (isBackNavigation: false) mainPage > loaded mainPage > navigatedTo (isBackNavigation: false) # frame.navigate(detailsPage) mainPage > navigatingFrom (isBackNavigation: false) detailsPage > navigatingTo (isBackNavigation: false) detailsPage > loaded mainPage > unloaded mainPage > navigatedFrom (isBackNavigation: false) detailsPage > navigatedTo (isBackNavigation: false) # frame.goBack() detailsPage > navigatingFrom (isBackNavigation: true) mainPage > navigatingTo (isBackNavigation: true) mainPage > loaded detailsPage > unloaded detailsPage > navigatedFrom (isBackNavigation: true) detailsPage > disposeNativeView # since it's no longer in the backstack mainPage > navigatedTo (isBackNavigation: true) ``` Navigating forward and clearing history ```bash # frame.navigate(mainPage) - initial navigation mainPage > navigatingTo (isBackNavigation: false) mainPage > loaded mainPage > navigatedTo (isBackNavigation: false) # frame.navigate(detailsPage, { clearHistory: true }) mainPage > navigatingFrom (isBackNavigation: false) detailsPage > navigatingTo (isBackNavigation: false) detailsPage > loaded mainPage > unloaded mainPage > navigatedFrom (isBackNavigation: false) mainPage > disposeNativeView detailsPage > navigatedTo (isBackNavigation: false) # frame.goBack() - no-op, there's nothing in the backstack. ``` Navigating forward without a backstack entry ```bash # frame.navigate(mainPage, { backstackVisible: false }) - initial navigation mainPage > navigatingTo (isBackNavigation: false) mainPage > loaded mainPage > navigatedTo (isBackNavigation: false) # frame.navigate(detailsPage) mainPage > navigatingFrom (isBackNavigation: false) detailsPage > navigatingTo (isBackNavigation: false) detailsPage > loaded mainPage > unloaded mainPage > navigatedFrom (isBackNavigation: false) mainPage > disposeNativeView # since backstackVisible: false, we won't be able to reach mainPage after this point detailsPage > navigatedTo (isBackNavigation: false) ``` ## Examples [​](https://docs.nativescript.org/ui/page\#examples) ### Getting a reference to the current Page [​](https://docs.nativescript.org/ui/page\#getting-a-reference-to-the-current-page) NativeScript provides various ways to access the current Page instance. #### Via Page Events [​](https://docs.nativescript.org/ui/page\#via-page-events) Any events emitted by the Page will have a reference to the Page itself via `args.object`. For example: ```ts // loaded event onPageLoaded(args: LoadEventData) { const page = args.object as Page; } // navigatedTo event onNavigatedTo(args: NavigatedData) { const page = args.object as Page; } ``` #### Via the page property of any View within the Page [​](https://docs.nativescript.org/ui/page\#via-the-page-property-of-any-view-within-the-page) Any View nested inside a Page hierarchy can access the Page via the `page` property. ```ts onTap(args: EventData) { const button = args.object as Button const page = button.page as Page; } ``` #### Via the currentPage property of a Frame instance [​](https://docs.nativescript.org/ui/page\#via-the-currentpage-property-of-a-frame-instance) The currently displayed page can be accessed via the Frame, to get a reference to the frame you can use `Frame.topmost()` for example: ```ts import { Frame } from '@nativescript/core' const frame = Frame.topmost() const page = frame.currentPage // Page ``` See [Frame](https://docs.nativescript.org/ui/frame), [Getting a Frame Instance](https://docs.nativescript.org/ui/frame#getting-a-frame-instance). ### Handling various Page events [​](https://docs.nativescript.org/ui/page\#handling-various-page-events) A page emits various events during it's lifecycle, navigation events and general View events like `loaded`/ `unloaded`/ `layoutChanged` etc. Page DefinitionEvent Handlers ```xml ``` ```ts onLoaded(args: EventData) { const page = args.object as Page } onUnloaded(args: EventData) { const page = args.object as Page } onLayoutChanged(args: EventData) { const page = args.object as Page } onNavigatedTo(args: NavigatedData) { const page = args.object as Page console.log(args.isBackNavigation) } onNavigatingFrom(args: NavigatedData) { const page = args.object as Page console.log(args.isBackNavigation) } onNavigatedFrom(args: NavigatedData) { const page = args.object as Page console.log(args.isBackNavigation) } ``` ## Props [​](https://docs.nativescript.org/ui/page\#props) ### actionBar [​](https://docs.nativescript.org/ui/page\#actionbar) ```ts actionBar: ActionBar ``` Gets or sets the ActionBar for this page. See [ActionBar](https://docs.nativescript.org/ui/action-bar). ### actionBarHidden [​](https://docs.nativescript.org/ui/page\#actionbarhidden) ```ts actionBarHidden: boolean ``` Allows hiding the ActionBar. Defaults to `false`. ### frame [​](https://docs.nativescript.org/ui/page\#frame) ```ts frame: Frame ``` The Frame instance containing the page. See [Frame](https://docs.nativescript.org/ui/frame). ### navigationContext [​](https://docs.nativescript.org/ui/page\#navigationcontext) ```ts navigationContext: any ``` A context used to pass data during navigation. ### backgroundSpanUnderStatusBar [​](https://docs.nativescript.org/ui/page\#backgroundspanunderstatusbar) ```ts backgroundSpanUnderStatusBar: boolean ``` Gets or sets whether the background of the page spans under the status bar. Defaults to `false`. ### androidStatusBarBackground [​](https://docs.nativescript.org/ui/page\#androidstatusbarbackground) ```ts androidStatusBarBackground: Color ``` Gets or sets the color of the status bar on Android devices. **Android only.** See [Color](https://docs.nativescript.org/api/class/Color). ### enableSwipeBackNavigation [​](https://docs.nativescript.org/ui/page\#enableswipebacknavigation) ```ts enableSwipeBackNavigation: boolean ``` Gets or sets whether the page can be swiped back on iOS. **iOS only.** Defaults to `true`. ### statusBarStyle [​](https://docs.nativescript.org/ui/page\#statusbarstyle) ```ts statusBarStyle: 'light' | 'dark' ``` Gets or sets the style of the status bar. ### ...Inherited [​](https://docs.nativescript.org/ui/page\#inherited) For additional inherited properties, refer to the [API Reference](https://docs.nativescript.org/api/class/Page). ## Events [​](https://docs.nativescript.org/ui/page\#events) ### loaded [​](https://docs.nativescript.org/ui/page\#loaded) ```ts on('loaded', (args: EventData) => { const page = args.object as Page console.log('Page loaded') }) ``` Emitted after the page has been loaded. ### navigatingTo [​](https://docs.nativescript.org/ui/page\#navigatingto) ```ts on('navigatingTo', (args: NavigatedData) => { const page = args.object as Page console.log('Page is being navigated to:', args.isBackNavigation) }) ``` Emitted before the app has navigated to the current page. ### navigatedTo [​](https://docs.nativescript.org/ui/page\#navigatedto) ```ts on('navigatedTo', (args: NavigatedData) => { const page = args.object as Page console.log('Page has been navigated to:', args.isBackNavigation) }) ``` Emitted after the app has navigated to the current page. ### navigatingFrom [​](https://docs.nativescript.org/ui/page\#navigatingfrom) ```ts on('navigatingFrom', (args: NavigatedData) => { const page = args.object as Page console.log('Page is being navigated from:', args.isBackNavigation) }) ``` Emitted before the app has navigated away from the current page. ### navigatedFrom [​](https://docs.nativescript.org/ui/page\#navigatedfrom) ```ts on('navigatedFrom', (args: NavigatedData) => { const page = args.object as Page console.log('Page has been navigated from:', args.isBackNavigation) }) ``` Emitted after the app has navigated away from the current page. ## Native component [​](https://docs.nativescript.org/ui/page\#native-component) - Android: [`org.nativescript.widgets.GridLayout`](https://github.com/NativeScript/NativeScript/blob/master/packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/GridLayout.java) - iOS: [`UIViewController`](https://developer.apple.com/documentation/uikit/uiviewcontroller) 2. [Page Lifecycle](https://docs.nativescript.org/ui/page#page-lifecycle) 1. [Lifecycle event examples](https://docs.nativescript.org/ui/page#lifecycle-event-examples) 3. [Examples](https://docs.nativescript.org/ui/page#examples) 1. [Getting a reference to the current Page](https://docs.nativescript.org/ui/page#getting-a-reference-to-the-current-page) 2. [Handling various Page events](https://docs.nativescript.org/ui/page#handling-various-page-events) 4. [Props](https://docs.nativescript.org/ui/page#props) 1. [actionBar](https://docs.nativescript.org/ui/page#actionbar) 2. [actionBarHidden](https://docs.nativescript.org/ui/page#actionbarhidden) 3. [frame](https://docs.nativescript.org/ui/page#frame) 4. [navigationContext](https://docs.nativescript.org/ui/page#navigationcontext) 5. [backgroundSpanUnderStatusBar](https://docs.nativescript.org/ui/page#backgroundspanunderstatusbar) 6. [androidStatusBarBackground](https://docs.nativescript.org/ui/page#androidstatusbarbackground) 7. [enableSwipeBackNavigation](https://docs.nativescript.org/ui/page#enableswipebacknavigation) 8. [statusBarStyle](https://docs.nativescript.org/ui/page#statusbarstyle) 9. [...Inherited](https://docs.nativescript.org/ui/page#inherited) 5. [Events](https://docs.nativescript.org/ui/page#events) 1. [loaded](https://docs.nativescript.org/ui/page#loaded) 2. [navigatingTo](https://docs.nativescript.org/ui/page#navigatingto) 3. [navigatedTo](https://docs.nativescript.org/ui/page#navigatedto) 4. [navigatingFrom](https://docs.nativescript.org/ui/page#navigatingfrom) 5. [navigatedFrom](https://docs.nativescript.org/ui/page#navigatedfrom) 6. [Native component](https://docs.nativescript.org/ui/page#native-component) ## NativeScript Webpack Configuration Note This section is only aplicable to `@nativescript/webpack` version `5.0.0` and above. If you are using an older version, consider upgrading. All NativeScript applications are bundled using webpack. To manage the required configuration, we maintain the `@nativescript/webpack` package. All new projects come with the base `webpack.config.js` that's pre-configured to build a NativeScript app: js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) // Learn how to customize: // https://docs.nativescript.org/webpack return webpack.resolveConfig() } ``` The above config configures most things required to bundle a NativeScript application. Internally it's using [webpack-chain](https://github.com/neutrinojs/webpack-chain) to generate the final config that is passed to webpack. In some cases you may wish to extend the configuration, which is possible using the [API](https://docs.nativescript.org/configuration/webpack#api) for applications, and the [Plugin API](https://docs.nativescript.org/configuration/webpack#plugin-api) for plugins. This page contains many examples of common things you might want to change in the [Examples of configurations section](https://docs.nativescript.org/configuration/webpack#examples-of-configurations) \- for anything else not mentioned here, refer to the [webpack-chain documentation](https://github.com/neutrinojs/webpack-chain). ## CLI Flags [​](https://docs.nativescript.org/configuration/webpack\#cli-flags) When running a NativeScript app the following flags have an effect on the final webpack config ### --no-hmr [​](https://docs.nativescript.org/configuration/webpack\#no-hmr) Disable HMR (enabled by default) ### --env.verbose [​](https://docs.nativescript.org/configuration/webpack\#env-verbose) Prints verbose logs and the internal config before building ### --env.replace=from:to [​](https://docs.nativescript.org/configuration/webpack\#env-replace-from-to) Add file replacement rules. For source files ( `.js` and `.ts`) this will add a new alias to the config, for everything else, it will add a new copy rule. Example: ```bash --env.replace=./src/environments/environment.ts:./src/environments/environment.prod.ts ``` will add an alias, so the following code ```ts import { environment } from './environments/environment.ts' ``` would resolve the import path to `./environments/environment.prod.ts`. ### --env.appComponents [​](https://docs.nativescript.org/configuration/webpack\#env-appcomponents) Allows passing additional App Components for android. For example if you have a custom activity defined in `myCustomActivity.ts` you can pass `--env.appComponents=myCustomActivity.ts` to include it in the build. ### --env.production [​](https://docs.nativescript.org/configuration/webpack\#env-production) Enable production mode. This will minify the bundle using Terser. ### --env.report [​](https://docs.nativescript.org/configuration/webpack\#env-report) Generate a report with the BundleAnalyzerPlugin ### --env.profile [​](https://docs.nativescript.org/configuration/webpack\#env-profile) Generate a `webpack.stats.json` to analyze on [https://webpack.github.io/analyse/](https://webpack.github.io/analyse/) ### --env.watchNodeModules [​](https://docs.nativescript.org/configuration/webpack\#env-watchnodemodules) Enable watching `node_modules` for changes. Useful when debugging plugins and making changes directly in `node_modules`. ### --env.e2e [​](https://docs.nativescript.org/configuration/webpack\#env-e2e) Enables E2E (end-to-end) mode - this currently enables the `testID` property in `@nativescript/core`. ### Additional flags [​](https://docs.nativescript.org/configuration/webpack\#additional-flags) Additional env flags that are usually passed by the CLI automatically - `--env.appPath` \- path to the app source (same as `appPath` in the `nativescript.config.ts`) - `--env.appResourcesPath` \- path to App\_Resources (same as `appResourcesPath` in the `nativescript.config.ts`) - `--env.nativescriptLibPath` \- path to the currently running CLI's library. - `--env.android` \- `true` when running on android - `--env.ios` \- `true` when running on ios - `--env.platform=` \- for specifying the platform to use. Can be `android` or `ios`, or a custom platform in the future. - `--env.hmr` \- `true` when building with HMR enabled ## Global "magic" variables [​](https://docs.nativescript.org/configuration/webpack\#global-magic-variables) We define a few useful globally available variables that you can use to alter logic in your applications. - `__DEV__` \- `true` when webpack is building in development mode ```ts if (__DEV__) { // we are running a dev build } ``` - `global.isAndroid`, (available as `__ANDROID__` too) - `true` when the platform is Android ```ts if (global.isAndroid) { // we are running on android } ``` - `global.isIOS`, (available as `__IOS__` too) - `true` when the platform is iOS ```ts if (global.isIOS) { // we are running on iOS } ``` The following variables are also defined, but are primarily intended to be used by NativeScript Core internally, or plugins that wish to use these. - `__NS_WEBPACK__` \- always `true` when building with webpack - `__NS_ENV_VERBOSE__` \- `true` when `--env.verbose` is set - `__NS_DEV_HOST_IPS__` \- an array of IP addresses of the host machine (the machine running the build) when in `development` mode, and an empty array in production mode. - `__CSS_PARSER__` \- the CSS parser used by NativeScript Core. The value is set based on the `cssParser` value in the `nativescript.config.ts` and defaults to `css-tree` - `__UI_USE_XML_PARSER__` \- a flag used by NativeScript Core to disable the XML parser when it's not used - `__UI_USE_EXTERNAL_RENDERER__` \- a flag used by NativeScript Core to disable registering global modules when an external renderer is used. ## Using DotEnv files [​](https://docs.nativescript.org/configuration/webpack\#using-dotenv-files) [DotEnv](https://github.com/mrsteele/dotenv-webpack) is pre-configured to allow defining environment variables to be made available during runtime. You can create a `.env` file in your project root and define values that will be available to your app during runtime. In case you need multiple environments, you can create additional env files with the naming convention of `.env.` (e.g. `.env.prod`, `.env.staging`). The following logic is used when loading environment files: - `.env` is loaded by default if it exists - `.env.` is loaded when `--env.env=` is passed to the build/run command and `.env.` exists, otherwise it falls back to loading `.env` (if it exists) As a general practice, `.env` files should not be committed to your source repository as they can contain sensitive values. Often times a `.env.example` is committed with all the variable names omitting the values, and each developer would then duplicate it to a `.env` or `.env.` file and fill in the values. ### Example DotEnv files [​](https://docs.nativescript.org/configuration/webpack\#example-dotenv-files) The following files in the project root will make `MY_API_ENDPOINT` and `MY_API_SECRET` available in the app codebase. ```bash # example .env file MY_API_ENDPOINT=https://staging-api-host/api/v2 MY_API_SECRET=supersecrettoken ``` ```bash # example .env.prod file MY_API_ENDPOINT=https://production-api-host/api/v2 MY_API_SECRET=verysuperverysecretverytoken ``` Running the app would allow you to access these variables through `process.env.`. Note Please note that the way DotEnv works is it's using the webpack [DefinePlugin](https://docs.nativescript.org/configuration/webpack#extending-the-defineplugin-options) internally to define the `process.env.` values, meaning they are essentially statically replaced in the bundled code. This is important to keep in mind because destructuring, or looping over `process` or `process.env` is not possible. See details about the limitations in the [DotEnv documentation](https://github.com/mrsteele/dotenv-webpack#limitations) ```ts // default, no flags - loaded from .env by default console.log(process.env.MY_API_ENDPOINT) // https://staging-api-host/api/v2 console.log(process.env.MY_API_SECRET) // supersecrettoken ``` ```ts // With --env.env=prod: loaded from .env.prod console.log(process.env.MY_API_ENDPOINT) // https://production-api-host/api/v2 console.log(process.env.MY_API_SECRET) // verysuperverysecretverytoken ``` ```ts // With --env.env=nonexistent: falls back to .env console.log(process.env.MY_API_ENDPOINT) // https://staging-api-host/api/v2 console.log(process.env.MY_API_SECRET) // supersecrettoken ``` ## Configuration examples [​](https://docs.nativescript.org/configuration/webpack\#configuration-examples) Here are some common examples of things you may want to do in your `webpack.config.js`. Note that the config is built using [webpack-chain](https://github.com/neutrinojs/webpack-chain), so the `config` variable in all the examples below are instances of a chainable config. You can find more examples in webpack-chain's documentation as well as read the [source of the base configs](https://github.com/NativeScript/NativeScript/tree/fb2c29106378f21583d890174f1c5a6bca6e6b8a/packages/webpack5/src/configuration) to see how we implemented them. ### Adding a copy rule [​](https://docs.nativescript.org/configuration/webpack\#adding-a-copy-rule) js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) // Example: copy all markdown files to the build directory webpack.Utils.addCopyRule('**/*.md') // Example: copy all files from a dependency webpack.Utils.addCopyRule({ from: '@nativescript/webpack/stubs', to: 'custom/location', // the context of the "from" rule, in this case node_modules // we used the getProjectFilePath util here, but this could have been // a path.resolve(__dirname, 'node_modules') too. context: webpack.Utils.project.getProjectFilePath('node_modules'), }) return webpack.resolveConfig() } ``` For all the valid options you can pass, refer to the [CopyWebpackPlugin Documentation](https://webpack.js.org/plugins/copy-webpack-plugin/#patterns) ### Adding a plugin [​](https://docs.nativescript.org/configuration/webpack\#adding-a-plugin) js ``` const webpack = require('@nativescript/webpack') // import the plugin first const { BannerPlugin } = require('webpack') module.exports = (env) => { webpack.init(env) // first we add our callback to the internal chain webpack.chainWebpack((config) => { // we add the plugin config.plugin('BannerPlugin').use(BannerPlugin, [\ {\ banner: 'hello world',\ },\ ]) }) return webpack.resolveConfig() } ``` The second argument of the `.use` call is an array of arguments you would pass to the plugin. For example, the above example is converted from the official BannerPlugin docs that stated the following: js ``` new webpack.BannerPlugin({ banner: 'hello world', }) ``` ### Adding a resolver plugin [​](https://docs.nativescript.org/configuration/webpack\#adding-a-resolver-plugin) js ``` const webpack = require('@nativescript/webpack') const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin') module.exports = (env) => { webpack.init(env) webpack.chainWebpack((config) => { config.resolve.plugin('TsconfigPathsPlugin').use(TsconfigPathsPlugin) }) return webpack.resolveConfig() } ``` ### Adding a loader [​](https://docs.nativescript.org/configuration/webpack\#adding-a-loader) js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) webpack.chainWebpack((config) => { // add a new rule for *.something files config.module .rule('something') .test(/\.something$/) .use('something-loader') .loader('something-loader') .options({ example: true, }) }) return webpack.resolveConfig() } ``` ### Adding Externals [​](https://docs.nativescript.org/configuration/webpack\#adding-externals) js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) webpack.chainWebpack((config) => { config.externals( // make sure to keep pre-defined externals config.get('externals').concat([\ // add your own externals\ 'some-external-dependency',\ ]), ) }) return webpack.resolveConfig() } ``` ### Adding path aliases [​](https://docs.nativescript.org/configuration/webpack\#adding-path-aliases) You can define `import`-aliases for specific source directories. js ``` const webpack = require('@nativescript/webpack') const { resolve } = require('path') module.exports = (env) => { webpack.init(env) webpack.chainWebpack((config) => { // change the "@" alias to "app/libs" config.resolve.alias.set('@', resolve(__dirname, 'app/libs')) }) return webpack.resolveConfig() } ``` ### Extending the DefinePlugin options [​](https://docs.nativescript.org/configuration/webpack\#extending-the-defineplugin-options) js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) webpack.chainWebpack((config) => { config.plugin('DefinePlugin').tap((args) => { Object.assign(args[0], { 'global.isProduction': !!env.production, 'global.someNumber': 42, 'global.someString': JSON.stringify('some string value'), }) return args }) }) return webpack.resolveConfig() } ``` ### Changing an existing rule [​](https://docs.nativescript.org/configuration/webpack\#changing-an-existing-rule) To change an existing rule, it's useful to know how it has been set up first: ```bash ns prepare android|ios --env.verbose # Note: we plan to add a separate command to just print the internal config ``` Will print the resolved internal config with helpful comments above each rule that you can grab and use. For example: js ``` // ... /* config.module.rule('js') */ { test: /\.js$/, exclude: [\ /node_modules/\ ], use: [\ /* config.module.rule('js').use('babel-loader') */\ {\ loader: 'babel-loader',\ options: {\ generatorOpts: {\ compact: false\ }\ }\ }\ ] }, // ... ``` To add a new loader, we can use the same syntax we used above for adding new loaders: js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) webpack.chainWebpack((config) => { config.module .rule('js') .use('something-loader') .loader('something-loader') .options({ example: true, }) }) return webpack.resolveConfig() } ``` ### Changing an existing loader options [​](https://docs.nativescript.org/configuration/webpack\#changing-an-existing-loader-options) js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) webpack.chainWebpack((config) => { config.module .rule('scss') .use('sass-loader') .options({ sassOptions: { indentedSyntax: true } }) }) return webpack.resolveConfig() } ``` ### Changing an existing plugin configuration [​](https://docs.nativescript.org/configuration/webpack\#changing-an-existing-plugin-configuration) Let's change the BannerPlugin we added above: js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) webpack.chainWebpack((config) => { config.plugin('BannerPlugin').tap((args) => { // args is and Array of all the arguments passed to the BannerPlugin constructor // args[0] is the first argument, which we set above. // be careful when accessing an array index // and do proper checks before writing to // avoid errors args[0].banner = 'changed banner.' // should always return all the arguments that should be passed to the plugin constructor // in some cases you may want to remove an argument - you can do that by returning an array // with that argument removed from it. return args }) }) return webpack.resolveConfig() } ``` ### Explicitly set base config [​](https://docs.nativescript.org/configuration/webpack\#explicitly-set-base-config) In some cases, you may want to explicitly set which base config should be used. For example in the NativeScript-Vue repository, the `sample` app doesn't have `nativescript-vue` listed as a dependency, so we have to specify the base config we want to use. js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) // set the base config // can be false to opt out from using a base config (used mostly in tests) // or can be one of the base configs: base, angular, javascript, react, svelte, typescript, vue webpack.useConfig('vue') return webpack.resolveConfig() } ``` ### Suppressing warnings [​](https://docs.nativescript.org/configuration/webpack\#suppressing-warnings) If your build produces warnings that you want to hide, you can do that with the following: js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) webpack.chainWebpack((config) => { config.set( 'ignoreWarnings', (config.get('ignoreWarnings') || []).concat([\ /a regex that matches the warning to suppress/,\ ]), ) }) return webpack.resolveConfig() } ``` ### Merging options into the config [​](https://docs.nativescript.org/configuration/webpack\#merging-options-into-the-config) For simple things, you can merge objects into the final config instead of using `chainWebpack` js ``` const webpack = require('@nativescript/webpack') module.exports = (env) => { webpack.init(env) // merge a simple object webpack.mergeWebpack({ mode: 'production' }) // using a function webpack.mergeWebpack((env) => { // return the object to be merged return { mode: 'production', } }) return webpack.resolveConfig() } ``` ## Plugin API [​](https://docs.nativescript.org/configuration/webpack\#plugin-api) NativeScript plugins can provide a `nativescript.webpack.js` file in their root folder (next to `package.json`), and `@nativescript/webpack` will include these configs when resolving the final config. For example, a plugin could register a new loader it requires: js ``` /** * This optionally provides typehints * this requires "@nativescript/webpack" to be a dependency (dev) * * @param {typeof import("@nativescript/webpack")} webpack */ module.exports = (webpack) => { // same API as the user configs // for example make changes to the internal config with webpack-chain webpack.chainWebpack( (config, env) => { // as an example - add a new rule for svg files config.module .rule('something') .test(/\.something$/) .use('something-loader') .loader('something-loader') } /*, options */, ) } ``` ## API [​](https://docs.nativescript.org/configuration/webpack\#api) ### init [​](https://docs.nativescript.org/configuration/webpack\#init) ```ts webpack.init(env: IWebpackEnv): void ``` **Required**: initialize the internal `env` object that's used throughout the config building process. The passed env should be an object containing key-value pairs. This is generally handled by webpack. * * * ### useConfig [​](https://docs.nativescript.org/configuration/webpack\#useconfig) ```ts webpack.useConfig(config: string | false): void ``` _Optional_: specify base config - defaults to auto-discovery. Passing `false` will opt-out from using a base config, however this is generally never recommended. * * * ### chainWebpack [​](https://docs.nativescript.org/configuration/webpack\#chainwebpack) ```ts webpack.chainWebpack(chainFn, options?): void ``` _Optional_: add a new `chainFn` to the internal chain that will be called while resolving the final config. The `chainFn` should be a function that accepts 2 parameters — `config` and `env`. The `options` is an optional object with the following optional properties: - `order: number`: controls the order in which the `chainFn` should be applied. Useful when related plugins rely on changes made in the right order. For example, `plugin1` can specify `order: 1` and `plugin2` can specify `order: 2` \- this will guarantee that `plugin1`'s `chainFn` is called first, and that `plugin2` can rely on values set by `plugin1`. **Example: Force production mode** js ``` webpack.chainWebpack((config, env) => { config.mode('production') }) ``` **Example: Run a config "last"** Setting `order: 10` doesn't necessarily guarantee the `chainFn` will be applied last, since other calls to `chainWebpack` could specify a higher number. We recommend against setting higher values, and using `10` as a conventional "last". js ``` webpack.chainWebpack( (config, env) => { config.set('somethingThatShouldBeSetLast', true) }, { order: 10 }, ) ``` * * * ### mergeWebpack [​](https://docs.nativescript.org/configuration/webpack\#mergewebpack) ```ts webpack.mergeWebpack(mergeFnOrObject): void ``` _Optional_: merges an object (or an object returned by a function) into the resolved chain config. **Example** js ``` // merge an object into the internal config webpack.mergeWebpack({ something: true, }) // or pass a function that returns an object webpack.mergeWebpack((env) => { return { something: true, } }) ``` * * * ### resolveChainableConfig [​](https://docs.nativescript.org/configuration/webpack\#resolvechainableconfig) ```ts webpack.resolveChainableConfig(): ChainableConfig // Config from webpack-chain ``` Resolve a new instance of the internal chain config with all chain functions applied. * * * ### resolveConfig [​](https://docs.nativescript.org/configuration/webpack\#resolveconfig) ```ts webpack.resolveConfig(): Config // Config from webpack ``` Resolve a "final" configuration that has all chain functions and merges applied. This returns a config that webpack can process. 2. [CLI Flags](https://docs.nativescript.org/configuration/webpack#cli-flags) 01. [--no-hmr](https://docs.nativescript.org/configuration/webpack#no-hmr) 02. [--env.verbose](https://docs.nativescript.org/configuration/webpack#env-verbose) 03. [--env.replace=from:to](https://docs.nativescript.org/configuration/webpack#env-replace-from-to) 04. [--env.appComponents](https://docs.nativescript.org/configuration/webpack#env-appcomponents) 05. [--env.production](https://docs.nativescript.org/configuration/webpack#env-production) 06. [--env.report](https://docs.nativescript.org/configuration/webpack#env-report) 07. [--env.profile](https://docs.nativescript.org/configuration/webpack#env-profile) 08. [--env.watchNodeModules](https://docs.nativescript.org/configuration/webpack#env-watchnodemodules) 09. [--env.e2e](https://docs.nativescript.org/configuration/webpack#env-e2e) 10. [Additional flags](https://docs.nativescript.org/configuration/webpack#additional-flags) 3. [Global "magic" variables](https://docs.nativescript.org/configuration/webpack#global-magic-variables) 4. [Using DotEnv files](https://docs.nativescript.org/configuration/webpack#using-dotenv-files) 1. [Example DotEnv files](https://docs.nativescript.org/configuration/webpack#example-dotenv-files) 5. [Configuration examples](https://docs.nativescript.org/configuration/webpack#configuration-examples) 01. [Adding a copy rule](https://docs.nativescript.org/configuration/webpack#adding-a-copy-rule) 02. [Adding a plugin](https://docs.nativescript.org/configuration/webpack#adding-a-plugin) 03. [Adding a resolver plugin](https://docs.nativescript.org/configuration/webpack#adding-a-resolver-plugin) 04. [Adding a loader](https://docs.nativescript.org/configuration/webpack#adding-a-loader) 05. [Adding Externals](https://docs.nativescript.org/configuration/webpack#adding-externals) 06. [Adding path aliases](https://docs.nativescript.org/configuration/webpack#adding-path-aliases) 07. [Extending the DefinePlugin options](https://docs.nativescript.org/configuration/webpack#extending-the-defineplugin-options) 08. [Changing an existing rule](https://docs.nativescript.org/configuration/webpack#changing-an-existing-rule) 09. [Changing an existing loader options](https://docs.nativescript.org/configuration/webpack#changing-an-existing-loader-options) 10. [Changing an existing plugin configuration](https://docs.nativescript.org/configuration/webpack#changing-an-existing-plugin-configuration) 11. [Explicitly set base config](https://docs.nativescript.org/configuration/webpack#explicitly-set-base-config) 12. [Suppressing warnings](https://docs.nativescript.org/configuration/webpack#suppressing-warnings) 13. [Merging options into the config](https://docs.nativescript.org/configuration/webpack#merging-options-into-the-config) 6. [Plugin API](https://docs.nativescript.org/configuration/webpack#plugin-api) 7. [API](https://docs.nativescript.org/configuration/webpack#api) 1. [init](https://docs.nativescript.org/configuration/webpack#init) 2. [useConfig](https://docs.nativescript.org/configuration/webpack#useconfig) 3. [chainWebpack](https://docs.nativescript.org/configuration/webpack#chainwebpack) 4. [mergeWebpack](https://docs.nativescript.org/configuration/webpack#mergewebpack) 5. [resolveChainableConfig](https://docs.nativescript.org/configuration/webpack#resolvechainableconfig) 6. [resolveConfig](https://docs.nativescript.org/configuration/webpack#resolveconfig) ## NativeScript Navigation Guide When it comes to navigation, there are two primary types of navigation, regular navigation using [Frame](https://docs.nativescript.org/ui/frame) & [Page](https://docs.nativescript.org/ui/frame), and navigation using modals. The key difference is the handling of the backstack and the back button—modals allow navigating the user through a "detached" flow, while Frames & Pages usually keep track of the backstack. It's important to note that modals can have their own Frame & Page backstack too, allowing for great flexibility when designing the navigation of your app. - [Navigation using Frames and Pages](https://docs.nativescript.org/guide/navigation/frames-and-pages) - [Navigation using Modals](https://docs.nativescript.org/guide/navigation/modals) ## Example user flow [​](https://docs.nativescript.org/guide/navigation/\#example-user-flow) For example, let's assume we have a **Home Page**, from which the user can navigate to a **List Page**. On the **List Page** the user is able to tweak some filters, we can show these in a modal to not disrupt the backstack/back button flow. When the user taps on a list item, we navigate to a **Details Page**. On the **Details Page** the user can view an additional **Info Page** in the **Info Modal** and navigate around further without disrupting the main backstack, once the **Info Modal** is closed, the user can continue navigating forwards and back in the **Main Frame**. ![](https://docs.nativescript.org/assets/Frame_Page_Modal_Timeline.drawio.5e028c34.svg) 2. [Example user flow](https://docs.nativescript.org/guide/navigation/#example-user-flow) ## Network Connectivity APIs `Connectivity` provides easy-to-use APIs consolidating the appropriate platform native APIs to interact with the network's connection type and availability. ## Using Connectivity [​](https://docs.nativescript.org/core/connectivity\#using-connectivity) To use Connectivity, import it from `@nativescript/core`. ```ts import { Connectivity } from '@nativescript/core' ``` ### Getting the current connection type [​](https://docs.nativescript.org/core/connectivity\#getting-the-current-connection-type) To check what type of network is currently connected use the [getConnectionType()](https://docs.nativescript.org/core/connectivity#getConnectionType) method. ```ts const connectionType: number = Connectivity.getConnectionType() if (connectionType) { // `Connectivity.connectionType.none`` is `0` so truthiness can be used to determine if the device is connected to any type of network fetch('https://httpbin.org/get') .then((response) => response.text()) .then((result) => console.log(`Fetched ${result} with ${connectionType}`)) } else { console.log('Not connected to a network.') } ``` Conditional behavior can easily be added for certain types of connections using the `Connectivity.connectionType` enum. ```ts if ( connectionType === Connectivity.connectionType.wifi || connectionType === Connectivity.connectionType.ethernet ) { // Download large file } else { // Download mobile friendly file } ``` ### Monitor changes to the connection type [​](https://docs.nativescript.org/core/connectivity\#monitor-changes-to-the-connection-type) Using the [startMonitoring()](https://docs.nativescript.org/core/connectivity#startMonitoring) method changes to the connection type can be observed. ```ts Connectivity.startMonitoring((change: number) => { switch (change) { case Connectivity.connectionType.wifi: case Connectivity.connectionType.ethernet: console.log('Connected to home network') break case Connectivity.connectionType.mobile: case Connectivity.connectionType.bluetooth: console.log('Connected to mobile network') break case Connectivity.connectionType.vpn: console.log('Connected to vpn network') break default: console.log('Not connected to any network') break } }) ``` If you wish to halt the monitoring of connectivity changes, use the [stopMonitoring()](https://docs.nativescript.org/core/connectivity#stopMonitoring) function. ```ts Connectivity.stopMonitoring() ``` ## API [​](https://docs.nativescript.org/core/connectivity\#api) ### getConnectionType() [​](https://docs.nativescript.org/core/connectivity\#getconnectiontype) ```ts Connectivity.getConnectionType(): number ``` This method retrieves the current connection type. It returns a number value representing one of the `connectionType` enumeration values. Note For Android, the `android.permission.ACCESS_NETWORK_STATE` permission must be added to the `AndroidManifest.xml` file to use this method. * * * ### startMonitoring() [​](https://docs.nativescript.org/core/connectivity\#startmonitoring) ```ts Connectivity.startMonitoring(connectionTypeChangedCallback: (newConnectionType: number) => void): void ``` This method initiates the monitoring of the network connection type. The `connectionTypeChangedCallback` is a function that will be invoked when the network connection type changes. * * * ### stopMonitoring() [​](https://docs.nativescript.org/core/connectivity\#stopmonitoring) ```ts Connectivity.stopMonitoring() ``` This method halts the monitoring of the network connection type. * * * ### connectionType [​](https://docs.nativescript.org/core/connectivity\#connectiontype) ```ts Connectivity.connectionType: number ``` This enumeration defines the different possible connection types. More connection types - `none = 0` - `wifi = 1` - `mobile = 2`, - `ethernet = 3`, - `bluetooth = 4`, - `vpn = 5` * * * ## API Reference(s) [​](https://docs.nativescript.org/core/connectivity\#api-reference-s) - [@nativescript/core/connectivity](https://docs.nativescript.org/api/namespace/Connectivity) module - [connectionType](https://docs.nativescript.org/api/enum/Connectivity-connectionType) enum ## Native Component [​](https://docs.nativescript.org/core/connectivity\#native-component) - `Android`: [CONNECTIVITY\_SERVICE (android.content.Context)](https://developer.android.com/reference/android/content/Context) - `iOS`: [SCNetworkReachability](https://developer.apple.com/documentation/systemconfiguration/scnetworkreachability-g7d) 2. [Using Connectivity](https://docs.nativescript.org/core/connectivity#using-connectivity) 1. [Getting the current connection type](https://docs.nativescript.org/core/connectivity#getting-the-current-connection-type) 2. [Monitor changes to the connection type](https://docs.nativescript.org/core/connectivity#monitor-changes-to-the-connection-type) 3. [API](https://docs.nativescript.org/core/connectivity#api) 1. [getConnectionType()](https://docs.nativescript.org/core/connectivity#getconnectiontype) 2. [startMonitoring()](https://docs.nativescript.org/core/connectivity#startmonitoring) 3. [stopMonitoring()](https://docs.nativescript.org/core/connectivity#stopmonitoring) 4. [connectionType](https://docs.nativescript.org/core/connectivity#connectiontype) 4. [API Reference(s)](https://docs.nativescript.org/core/connectivity#api-reference-s) 5. [Native Component](https://docs.nativescript.org/core/connectivity#native-component) ## NativeScript Button Component ` ``` ```tsx ``` ```tsx ``` ```svelte ``` ```vue ``` ## Examples [​](https://docs.nativescript.org/ui/button\#examples) ### Formatting text inside a Button [​](https://docs.nativescript.org/ui/button\#formatting-text-inside-a-button) If you need to style parts of the text, you can use a combination of a `FormattedString` and `Span` elements. ```xml ``` ## Props [​](https://docs.nativescript.org/ui/button\#props) ### text [​](https://docs.nativescript.org/ui/button\#text) ```ts text: string ``` Sets the text shown in the button. ### textWrap [​](https://docs.nativescript.org/ui/button\#textwrap) ```ts textWrap: boolean ``` Gets or sets whether the button should wrap longer text to new lines. Default value is `false`. ### isEnabled [​](https://docs.nativescript.org/ui/button\#isenabled) ```ts isEnabled: boolean ``` Allows disabling the button. A disabled button does not react to user gestures. Default value is `true`. ### ...Inherited [​](https://docs.nativescript.org/ui/button\#inherited) For additional inherited properties, refer to the [API Reference](https://docs.nativescript.org/api/class/Button). ## Events [​](https://docs.nativescript.org/ui/button\#events) ### tap [​](https://docs.nativescript.org/ui/button\#tap) ```ts on('tap', (args: TapGestureEventData) => { const button = args.object as Button console.log(`The button has been tapped!`) }) ``` Emitted when the button is tapped See [TapGestureEventData](https://docs.nativescript.org/api/interface/TapGestureEventData). ## Native component [​](https://docs.nativescript.org/ui/button\#native-component) - Android: [`android.widget.Button`](https://developer.android.com/reference/android/widget/Button.html) - iOS: [`UIButton`](https://developer.apple.com/documentation/uikit/uibutton) 2. [Examples](https://docs.nativescript.org/ui/button#examples) 1. [Formatting text inside a Button](https://docs.nativescript.org/ui/button#formatting-text-inside-a-button) 3. [Props](https://docs.nativescript.org/ui/button#props) 1. [text](https://docs.nativescript.org/ui/button#text) 2. [textWrap](https://docs.nativescript.org/ui/button#textwrap) 3. [isEnabled](https://docs.nativescript.org/ui/button#isenabled) 4. [...Inherited](https://docs.nativescript.org/ui/button#inherited) 4. [Events](https://docs.nativescript.org/ui/button#events) 1. [tap](https://docs.nativescript.org/ui/button#tap) 5. [Native component](https://docs.nativescript.org/ui/button#native-component) ## NativeScript Dialogs NativeScript offers various dialogs, available via the `Dialogs` import from `@nativescript/core`, or globally. ```ts import { Dialogs } from '@nativescript/core' Dialogs.alert(options) Dialogs.action(options) Dialogs.confirm(options) Dialogs.prompt(options) Dialogs.login(options) // is the same as: alert(options) action(options) confirm(options) prompt(options) login(options) ``` All dialogs take a `DialogOptions` object with the properties: - `title`: Sets the dialog title. - `message` : Sets the dialog message. - `cancelable` ( **Android only**): Sets if the dialog can be canceled by taping outside of the dialog. - `theme` ( **Android only**): Sets the theme of the Dialog. Usable themes can be found in [R.style](https://developer.android.com/reference/android/R.style) See [DialogOptions](https://docs.nativescript.org/api/interface/DialogOptions), [R.style](https://developer.android.com/reference/android/R.style). ## Avialable Dialogs [​](https://docs.nativescript.org/ui/dialogs\#avialable-dialogs) ### Alert [​](https://docs.nativescript.org/ui/dialogs\#alert) ![](https://docs.nativescript.org/assets/Dialogs-Alert.5178d13c.png) ![](https://docs.nativescript.org/assets/Dialogs-Alert.e5fce53e.png) ```ts Dialogs.alert({ title: 'Alert!', message: 'Please try again later.', okButtonText: 'OK', cancelable: true, }) ``` HTMLTypeScript ```html ``` ```ts showAlert() { Dialogs.alert({ title: 'Alert!', message: 'Please try again later.', okButtonText: 'OK', cancelable: true, }) } ``` ```tsx Dialogs.alert({ title: 'Alert!', message: 'Please try again later.', okButtonText: 'OK', cancelable: true, }) ``` ```tsx Dialogs.alert({ title: 'Alert!', message: 'Please try again later.', okButtonText: 'OK', cancelable: true, }) ``` ```svelte Dialogs.alert({ title: 'Alert!', message: 'Please try again later.', okButtonText: 'OK', cancelable: true, }) ``` ```vue Dialogs.alert({ title: 'Alert!', message: 'Please try again later.', okButtonText: 'OK', cancelable: true, }) ``` A dialog for alerting the user. See [alert()](https://docs.nativescript.org/api/#alert). ### Action [​](https://docs.nativescript.org/ui/dialogs\#action) ![](https://docs.nativescript.org/assets/Dialogs-Action.f360d3ba.png) ![](https://docs.nativescript.org/assets/Dialogs-Action.7978c5f6.png) ```ts Dialogs.action({ title: 'Action!', message: 'Choose your language:', cancelButtonText: 'Cancel', actions: ['TypeScript', 'JavaScript', 'Neither'], cancelable: true, destructiveActionsIndexes: [2], }).then((result) => { console.log(result) }) ``` HTMLTypeScript ```html ``` ```ts showAction() { Dialogs.action({ title: 'Action!', message: 'Choose your language:', cancelButtonText: 'Cancel', actions: ['TypeScript', 'JavaScript', 'Neither'], cancelable: true, destructiveActionsIndexes: [2], }).then((result) => { console.log(result) }) } ``` ```tsx Dialogs.action({ title: 'Action!', message: 'Choose your language:', cancelButtonText: 'Cancel', actions: ['TypeScript', 'JavaScript', 'Neither'], cancelable: true, destructiveActionsIndexes: [2], }) ``` ```tsx Dialogs.action({ title: 'Action!', message: 'Choose your language:', cancelButtonText: 'Cancel', actions: ['TypeScript', 'JavaScript', 'Neither'], cancelable: true, destructiveActionsIndexes: [2], }) ``` ```svelte Dialogs.action({ title: 'Action!', message: 'Choose your language:', cancelButtonText: 'Cancel', actions: ['TypeScript', 'JavaScript', 'Neither'], cancelable: true, destructiveActionsIndexes: [2], }) ``` ```vue Dialogs.action({ title: 'Action!', message: 'Choose your language:', cancelButtonText: 'Cancel', actions: ['TypeScript', 'JavaScript', 'Neither'], cancelable: true, destructiveActionsIndexes: [2], }).then((result) => { console.log(result) }) ``` A dialog for prompting the user to choose. **Note**: `destructiveActionsIndexes` allows setting some actions as destructive - shown in red. **iOS only.** See [action()](https://docs.nativescript.org/api/#action). ### Confirm [​](https://docs.nativescript.org/ui/dialogs\#confirm) ![](https://docs.nativescript.org/assets/Dialogs-Confirm.0782c165.png) ![](https://docs.nativescript.org/assets/Dialogs-Confirm.9dcee399.png) ```ts Dialogs.confirm({ title: 'Confirm!', message: 'Are you sure you want to do this?', okButtonText: 'Yes', cancelButtonText: 'No', neutralButtonText: 'Cancel', }).then((result) => { console.log(result) }) ``` HTMLTypeScript ```html ``` ```ts showConfirm() { Dialogs.confirm({ title: 'Confirm!', message: 'Are you sure you want to do this?', okButtonText: 'Yes', cancelButtonText: 'No', neutralButtonText: 'Cancel', }).then((result) => { console.log(result) }) } ``` ```tsx Dialogs.confirm({ title: 'Confirm!', message: 'Are you sure you want to do this?', okButtonText: 'Yes', cancelButtonText: 'No', neutralButtonText: 'Cancel', }) ``` ```tsx Dialogs.confirm({ title: 'Confirm!', message: 'Are you sure you want to do this?', okButtonText: 'Yes', cancelButtonText: 'No', neutralButtonText: 'Cancel', }) ``` ```svelte Dialogs.confirm({ title: 'Confirm!', message: 'Are you sure you want to do this?', okButtonText: 'Yes', cancelButtonText: 'No', neutralButtonText: 'Cancel', }) ``` ```vue Dialogs.confirm({ title: 'Confirm!', message: 'Are you sure you want to do this?', okButtonText: 'Yes', cancelButtonText: 'No', neutralButtonText: 'Cancel', }).then((result) => { console.log(result) }) ``` A dialog for prompting the user to confirm. See [confirm()](https://docs.nativescript.org/api/#confirm). ### Prompt [​](https://docs.nativescript.org/ui/dialogs\#prompt) ![](https://docs.nativescript.org/assets/Dialogs-Prompt.e5876065.png) ![](https://docs.nativescript.org/assets/Dialogs-Prompt.5b4ad2fc.png) ```ts Dialogs.prompt({ title: 'Prompt!', message: 'Enter the name of this framework:', defaultText: 'NativeScript', okButtonText: 'OK', neutralButtonText: 'Cancel', // cancelable: true, // cancelButtonText: 'Cancel', // capitalizationType: 'none', // inputType: 'email', }).then((result) => { console.log(result) }) ``` HTMLTypeScript ```html ``` ```ts showPrompt() { Dialogs.prompt({ title: 'Prompt!', message: 'Enter the name of this framework:', defaultText: 'NativeScript', okButtonText: 'OK', neutralButtonText: 'Cancel', // cancelable: true, // cancelButtonText: 'Cancel', // capitalizationType: 'none', // inputType: 'email', }).then((result) => { console.log(result) }) } ``` ```tsx Dialogs.prompt({ title: 'Prompt!', message: 'Enter the name of this framework:', defaultText: 'NativeScript', okButtonText: 'OK', neutralButtonText: 'Cancel', // cancelable: true, // cancelButtonText: 'Cancel', // capitalizationType: 'none', // inputType: 'email', }) ``` ```tsx Dialogs.prompt({ title: 'Prompt!', message: 'Enter the name of this framework:', defaultText: 'NativeScript', okButtonText: 'OK', neutralButtonText: 'Cancel', // cancelable: true, // cancelButtonText: 'Cancel', // capitalizationType: 'none', // inputType: 'email', }) ``` ```svelte Dialogs.prompt({ title: 'Prompt!', message: 'Enter the name of this framework:', defaultText: 'NativeScript', okButtonText: 'OK', neutralButtonText: 'Cancel', // cancelable: true, // cancelButtonText: 'Cancel', // capitalizationType: 'none', // inputType: 'email', }) ``` ```vue Dialogs.prompt({ title: 'Prompt!', message: 'Enter the name of this framework:', defaultText: 'NativeScript', okButtonText: 'OK', neutralButtonText: 'Cancel', // cancelable: true, // cancelButtonText: 'Cancel', // capitalizationType: 'none', // inputType: 'email', }).then((result) => { console.log(result) }) ``` A dialog for prompting the user for input. - `defaultText`: Sets the default text to display in the input box. - `inputType`: Sets the prompt input type: `email`, `decimal`, `phone`, `number`, `text`, `password`, or `email` - `capitalizationType`: Sets the prompt capitalization type. Avalable options: `none`, `allCharacters`, `sentences`, or `words`. See [prompt()](https://docs.nativescript.org/api/#prompt), [CoreTypes.AutocapitalizationType](https://docs.nativescript.org/api/namespace/CoreTypes-AutocapitalizationType) ### Login [​](https://docs.nativescript.org/ui/dialogs\#login) ![](https://docs.nativescript.org/assets/Dialogs-Login.fee16420.png) ![](https://docs.nativescript.org/assets/Dialogs-Login.ffcf2c76.png) ```ts Dialogs.login({ title: 'Login!', message: 'Enter your credentials', okButtonText: 'Login', cancelButtonText: 'Cancel', userName: 'NativeScript', password: 'hunter2', // neutralButtonText: 'Neutral', // cancelable: true, // passwordHint: 'Your password', // userNameHint: 'Your username', }).then((result) => { console.log(result) }) ``` HTMLTypeScript ```html ``` ```ts showLogin() { Dialogs.login({ title: 'Login!', message: 'Enter your credentials', okButtonText: 'Login', cancelButtonText: 'Cancel', userName: 'NativeScript', password: 'hunter2', // neutralButtonText: 'Neutral', // cancelable: true, // passwordHint: 'Your password', // userNameHint: 'Your username', }).then((result) => { console.log(result) }) } ``` ```tsx Dialogs.login({ title: 'Login!', message: 'Enter your credentials', okButtonText: 'Login', cancelButtonText: 'Cancel', userName: 'NativeScript', password: 'hunter2', // neutralButtonText: 'Neutral', // cancelable: true, // passwordHint: 'Your password', // userNameHint: 'Your username', }) } ``` ```tsx Dialogs.login({ title: 'Login!', message: 'Enter your credentials', okButtonText: 'Login', cancelButtonText: 'Cancel', userName: 'NativeScript', password: 'hunter2', // neutralButtonText: 'Neutral', // cancelable: true, // passwordHint: 'Your password', // userNameHint: 'Your username', }) } ``` ```svelte Dialogs.login({ title: 'Login!', message: 'Enter your credentials', okButtonText: 'Login', cancelButtonText: 'Cancel', userName: 'NativeScript', password: 'hunter2', // neutralButtonText: 'Neutral', // cancelable: true, // passwordHint: 'Your password', // userNameHint: 'Your username', }) } ``` ```vue Dialogs.login({ title: 'Login!', message: 'Enter your credentials', okButtonText: 'Login', cancelButtonText: 'Cancel', userName: 'NativeScript', password: 'hunter2', // neutralButtonText: 'Neutral', // cancelable: true, // passwordHint: 'Your password', // userNameHint: 'Your username', }).then((result) => { console.log(result) }) ``` A dialog for prompting the user for credentials. See [login()](https://docs.nativescript.org/api/#login). ## Native Component [​](https://docs.nativescript.org/ui/dialogs\#native-component) - Android: [android.app.AlertDialog.Builder](https://developer.android.com/reference/android/app/AlertDialog.Builder) - iOS: [UIAlertController](https://developer.apple.com/documentation/uikit/uialertcontroller) 2. [Avialable Dialogs](https://docs.nativescript.org/ui/dialogs#avialable-dialogs) 1. [Alert](https://docs.nativescript.org/ui/dialogs#alert) 2. [Action](https://docs.nativescript.org/ui/dialogs#action) 3. [Confirm](https://docs.nativescript.org/ui/dialogs#confirm) 4. [Prompt](https://docs.nativescript.org/ui/dialogs#prompt) 5. [Login](https://docs.nativescript.org/ui/dialogs#login) 3. [Native Component](https://docs.nativescript.org/ui/dialogs#native-component) ## Developing for Vision Pro ![Vision Pro](https://docs.nativescript.org/assets/vision-pro.420753ac.png) Apple provides [visionOS](https://developer.apple.com/visionos/) development starting with [Xcode 15.2](https://developer.apple.com/xcode/resources/) or higher. Note You will need an [Apple developer account](https://developer.apple.com/programs/enroll/) to download developer tools and SDKs. [Building visionOS apps with NativeScript ~ Choose the flavor you love](https://www.youtube.com/watch?v=1NGoY74-vZc) ## Create a visionOS project [​](https://docs.nativescript.org/guide/visionos\#create-a-visionos-project) You can develop with a physical Vision Pro plugged in or using the Vision Pro Simulator. **You will need at least the 8.7+ NativeScript CLI**: ```bash npm install -g nativescript@latest ``` You can now use the `--vision` (or `--visionos`) flags when creating your app. ```bash ns create myapp --vision ``` This will setup a preconfigured visionOS ready app using a plain TypeScript base. If you prefer a flavor, you can use any of the following: - [Angular](https://angular.io/): `ns create myapp --vision-ng` - [React](https://react.dev/): `ns create myapp --vision-react` - [Solid](https://www.solidjs.com/): `ns create myapp --vision-solid` - [Svelte](https://svelte.dev/): `ns create myapp --vision-svelte` - [Vue (3.x)](https://vuejs.org/): `ns create myapp --vision-vue` All projects are preconfigured with [tailwindcss](https://tailwindcss.com/). ### Run your visionOS project [​](https://docs.nativescript.org/guide/visionos\#run-your-visionos-project) Open the Vision Pro Simulator, then run your app with: ```bash ns run vision --no-hmr ``` The `vision` platform target is a shorthand alias for `visionos` so this can also be used: ```bash ns run visionos --no-hmr ``` #### Develop with physical Vision Pro [​](https://docs.nativescript.org/guide/visionos\#develop-with-physical-vision-pro) You can use a [Developer Strap](https://developer.apple.com/visionos/developer-strap/purchase) to connect your Vision Pro to your Mac. > The Developer Strap is an optional accessory that provides a USB-C connection between Apple Vision Pro and Mac and is helpful for accelerating the development of graphics-intensive apps and games. The Developer Strap provides the same audio experience as the in-box Right Audio Strap, so developers can keep the Developer Strap attached for both development and testing. Once connected, you can run `ns device` to list all connected physical devices: ```bash % ns device Searching for devices... Connected devices & emulators ┌───┬──────────────────┬──────────┬───────────────────────────┬────────┬───────────┬─────────────────┐ │ # │ Device Name │ Platform │ Device Identifier │ Type │ Status │ Connection Type │ │ 1 │ Apple Vision Pro │ visionOS │ 00008112-001A10812278A01E │ Device │ Connected │ USB │ ``` You can then run on that device as follows: ```bash ns run visionos --no-hmr --device=00008112-001A10812278A01E ``` ### What makes a project work on visionOS? [​](https://docs.nativescript.org/guide/visionos\#what-makes-a-project-work-on-visionos) Primarily 2 key elements make up a NativeScript driven visionOS project: 1. `App_Resources/visionOS/src/NativeScriptApp.swift` 2. The following dependencies: json ``` { "dependencies": { "@nativescript/core": "~8.8.0" }, "devDependencies": { "@nativescript/visionos": "~8.8.0", "@nativescript/webpack": "~5.0.0" } } ``` ## Design Guidelines and Notes [​](https://docs.nativescript.org/guide/visionos\#design-guidelines-and-notes) We strongly encourage developers to understand and use Apple's system glass materials throughout their apps in addition to closely following their design guidelines. We recommend watching the following WWDC 2023 videos covering visionOS for fundamental understandings: - [Design for spatial user interfaces](https://developer.apple.com/videos/play/wwdc2023/10076/) - [Design considerations for vision and motion](https://developer.apple.com/videos/play/wwdc2023/10078/) - [Meet UIKit for spatial computing](https://developer.apple.com/videos/play/wwdc2023/111215/) - [Create accessible spatial experiences](https://developer.apple.com/videos/play/wwdc2023/10034/) - [Explore immersive sound design](https://developer.apple.com/videos/play/wwdc2023/10271/) - [Deliver video content for spatial experiences](https://developer.apple.com/videos/play/wwdc2023/10071/) - [Create a great spatial playback experience](https://developer.apple.com/videos/play/wwdc2023/10070/) You may by interested in more [here](https://developer.apple.com/videos/wwdc2023/). ### CSS Adjustments for visionOS [​](https://docs.nativescript.org/guide/visionos\#css-adjustments-for-visionos) You will likely want to make your Pages transparent to allow the natural glass materials to come through by using this CSS specifier: ```css .ns-visionos Page { background-color: transparent; } ``` When running your app on `visionOS`, you can scope CSS selectors where needed by the root level `.ns-visionos` class. ### Hover effect for visionOS materials [​](https://docs.nativescript.org/guide/visionos\#hover-effect-for-visionos-materials) All standard/system UI Component usages like Button, Switch, Pickers, etc. will automatically get system hover style effects on visionOS. It's common to add `tap` bindings in NativeScript to things like StackLayout, GridLayout, etc. which are just [UIView](https://developer.apple.com/documentation/uikit/uiview)'s. You can use new @nativescript/core APIs to easily enable visionOS [hover styles](https://developer.apple.com/documentation/uikit/uihoverstyle) on any view type throughout your app or customize per view. Apple discusses some of the important spatial considerations with these effects in [this session](https://developer.apple.com/videos/play/wwdc2023/111215/). Each view can specify it's own custom `visionHoverStyle` as follows: ```xml ``` The `visionHoverStyle` property can be defined as a `string` or `VisionHoverOptions`. ```ts import { VisionHoverOptions } from '@nativescript/core' const visionHoverStyle: VisionHoverOptions = { effect: 'highlight', shape: 'rect', shapeCornerRadius: 16, } ``` This would apply a visionOS system highlight rectangle with a cornerRadius of 16 to that `GridLayout` when a hover is detected. The options are as follows: ```ts export type VisionHoverEffect = 'automatic' | 'highlight' | 'lift' export type VisionHoverShape = 'circle' | 'rect' export type VisionHoverOptions = { effect: VisionHoverEffect shape?: VisionHoverShape shapeCornerRadius?: number } ``` When a `string` is provided, it will look for predefined `visionHoverStyle`'s within the `TouchManager.visionHoverOptions` that match the string name. This allows you to predefine and share custom visionHoverStyle's across your entire app. You can enable these effects globally throughout your app for any view which has a `tap` binding by enabling: ```ts TouchManager.enableGlobalHoverWhereTap = true ``` This allows you to predefine any number of custom `visionHoverStyle`'s you'd like to use throughout your app. You could do so in the `app.ts` or `main.ts` (aka, bootstrap file), for example: ```ts TouchManager.enableGlobalHoverWhereTap = true TouchManager.visionHoverOptions = { default: { effect: 'highlight', shape: 'rect', shapeCornerRadius: 16, }, slimBox: { effect: 'lift', shape: 'rect', shapeCornerRadius: 8, }, round: { effect: 'lift', shape: 'circle', }, } ``` You could then apply custom `visionHoverStyle`'s by their name anywhere in your app: ```xml ``` You can also disable a hoverStyle on any view by adding the `visionIgnoreHoverStyle` property if desired. Note When no `visionHoverStyle` is defined and not using `TouchManager.enableGlobalHoverWhereTap`, visionOS will use default behavior by enabling hoverStyle's on standard controls as mentioned. Other views would have no hoverStyle as expected. ### View template visionOS scoping [​](https://docs.nativescript.org/guide/visionos\#view-template-visionos-scoping) You can also scope sections of your view templates specifically for visionOS layouts as needed: ```xml ``` Note You should not have to do a lot of this throughout apps in general but these options are available to you where desired. ## NativeScript and the SwiftUI App Lifecycle [​](https://docs.nativescript.org/guide/visionos\#nativescript-and-the-swiftui-app-lifecycle) Starting with NativeScript 8.6 we support the [SwiftUI App](https://developer.apple.com/documentation/swiftui/app) Lifecycle for the first time. For a better understanding of the SwiftUI App Lifecycle, we recommend the following articles: - [https://peterfriese.dev/posts/ultimate-guide-to-swiftui2-application-lifecycle/](https://peterfriese.dev/posts/ultimate-guide-to-swiftui2-application-lifecycle/) - [https://dev.to/sam\_programiz/swiftui-app-life-cycle-2n68](https://dev.to/sam_programiz/swiftui-app-life-cycle-2n68) > how can we tell the compiler about the entry point to our application? Historically with NativeScript apps, we would use the [Objective C main entry](https://github.com/NativeScript/ios/blob/d67588cb3866212ccd86b105edf1207fddde2db9/project-template/internal/main.m#L19) to define the entry point where the NativeScript engine was intialized and your app would be booted. We now also support a SwiftUI `@main` entry via a single `App_Resources/visionOS/src/NativeScriptApp.swift` file: swift ``` import SwiftUI @main struct NativeScriptApp: App { var body: some Scene { NativeScriptMainWindow() } } ``` The `NativeScriptMainWindow` is a SwiftUI [WindowGroup](https://developer.apple.com/documentation/swiftui/windowgroup) which returns a Scene, your NativeScript app. In visionOS apps, you can expand this `struct` to support new [Scenes](https://developer.apple.com/documentation/swiftui/scene) and [Spaces](https://developer.apple.com/documentation/visionos/presenting-windows-and-spaces) with new and exciting window styles like [volumetric](https://developer.apple.com/documentation/swiftui/windowstyle/volumetric/) as well as [Immersive Spaces](https://developer.apple.com/documentation/visionos/creating-fully-immersive-experiences). `NativeScriptMainWindow` is a SwiftUI struct representing a Scene itself which looks like this: swift ``` struct NativeScriptMainWindow: Scene { var body: some Scene { WindowGroup { NativeScriptAppView(found: { windowScene in NativeScriptEmbedder.sharedInstance().setWindowScene(windowScene) }).onAppear { // Your app is booted here! DispatchQueue.main.async { NativeScriptStart.boot() } } } .windowStyle(.plain) } init() { // NativeScript engine is configured here! NativeScriptEmbedder.sharedInstance().setDelegate(NativeScriptViewRegistry.shared) NativeScriptStart.setup() } } ``` Note This is enabled for `visionOS` only right now with NativeScript however this will be used in iOS and macOS apps in the future. ### Support multiple windows [​](https://docs.nativescript.org/guide/visionos\#support-multiple-windows) In order to add volumetric and immersize spaces, be sure you add the following setting to your `App_Resources/visionOS/Info.plist`: ```xml UIApplicationSceneManifest UIApplicationSupportsMultipleScenes ``` ## Vision Pro Tutorials in all Flavors [​](https://docs.nativescript.org/guide/visionos\#vision-pro-tutorials-in-all-flavors) You can follow along in these "Vision Pro 🥽 Hello World" tutorials: - [Develop Vision Pro 🥽 apps with TypeScript](https://blog.nativescript.org/develop-visionos-apps-with-typescript) - [Develop Vision Pro 🥽 apps with Angular](https://blog.nativescript.org/develop-visionos-apps-with-angular) - [Develop Vision Pro 🥽 apps with React](https://blog.nativescript.org/develop-visionos-apps-with-react) - [Develop Vision Pro 🥽 apps with Solid](https://blog.nativescript.org/develop-visionos-apps-with-solid) - [Develop Vision Pro 🥽 apps with Svelte](https://blog.nativescript.org/develop-visionos-apps-with-svelte) - [Develop Vision Pro 🥽 apps with Vue](https://blog.nativescript.org/develop-visionos-apps-with-vue) ### Vision Pro for Angular Developers [​](https://docs.nativescript.org/guide/visionos\#vision-pro-for-angular-developers) [How to Develop a Vision Pro App using Angular with Nathan Walker](https://www.youtube.com/watch?v=OXkUXRUOj5o) ## Blog Posts [​](https://docs.nativescript.org/guide/visionos\#blog-posts) ### Particle Systems via RealityKit and Multiple Scenes during Vision Pro development with NativeScript [​](https://docs.nativescript.org/guide/visionos\#particle-systems-via-realitykit-and-multiple-scenes-during-vision-pro-development-with-nativescript) [https://blog.nativescript.org/particles-and-multiple-scenes-vision-pro-development/](https://blog.nativescript.org/particles-and-multiple-scenes-vision-pro-development/) ### How to add visionOS to an existing app? [​](https://docs.nativescript.org/guide/visionos\#how-to-add-visionos-to-an-existing-app) [https://blog.nativescript.org/add-visionos-to-existing-nativescript-app/](https://blog.nativescript.org/add-visionos-to-existing-nativescript-app/) 2. [Create a visionOS project](https://docs.nativescript.org/guide/visionos#create-a-visionos-project) 1. [Run your visionOS project](https://docs.nativescript.org/guide/visionos#run-your-visionos-project) 2. [What makes a project work on visionOS?](https://docs.nativescript.org/guide/visionos#what-makes-a-project-work-on-visionos) 3. [Design Guidelines and Notes](https://docs.nativescript.org/guide/visionos#design-guidelines-and-notes) 1. [CSS Adjustments for visionOS](https://docs.nativescript.org/guide/visionos#css-adjustments-for-visionos) 2. [Hover effect for visionOS materials](https://docs.nativescript.org/guide/visionos#hover-effect-for-visionos-materials) 3. [View template visionOS scoping](https://docs.nativescript.org/guide/visionos#view-template-visionos-scoping) 4. [NativeScript and the SwiftUI App Lifecycle](https://docs.nativescript.org/guide/visionos#nativescript-and-the-swiftui-app-lifecycle) 1. [Support multiple windows](https://docs.nativescript.org/guide/visionos#support-multiple-windows) 5. [Vision Pro Tutorials in all Flavors](https://docs.nativescript.org/guide/visionos#vision-pro-tutorials-in-all-flavors) 1. [Vision Pro for Angular Developers](https://docs.nativescript.org/guide/visionos#vision-pro-for-angular-developers) 6. [Blog Posts](https://docs.nativescript.org/guide/visionos#blog-posts) 1. [Particle Systems via RealityKit and Multiple Scenes during Vision Pro development with NativeScript](https://docs.nativescript.org/guide/visionos#particle-systems-via-realitykit-and-multiple-scenes-during-vision-pro-development-with-nativescript) 2. [How to add visionOS to an existing app?](https://docs.nativescript.org/guide/visionos#how-to-add-visionos-to-an-existing-app) ## NativeScript Label Component ` ``` ```ts import { fromObject, Page, Button, ShownModallyData, EventData, } from '@nativescript/core' // optional strong type for the context export type ExampleModalContext = { name: string } export type ExampleModalResult = { newName: string } export function onShownModally(args: ShownModallyData) { const page = args.object as Page const incomingContext = args.context as ExampleModalContext const bindingContext = fromObject({ ...incomingContext, onChangeName(args: EventData) { const button = args.object as Button button.closeModal({ newName: bindingContext.name, // 'Jane Doe' } as ExampleModalResult) }, onCancel(args: EventData) { const view = args.object as View view.closeModal() }, }) page.bindingContext = bindingContext } ``` ## Additional Resources [​](https://docs.nativescript.org/guide/navigation/modals\#additional-resources) - [NativeScript XML Data Binding](https://docs.nativescript.org/guide/data-binding) - [TextField](https://docs.nativescript.org/ui/text-field) 2. [Showing a modal](https://docs.nativescript.org/guide/navigation/modals#showing-a-modal) 3. [Closing a modal](https://docs.nativescript.org/guide/navigation/modals#closing-a-modal) 4. [Passing data](https://docs.nativescript.org/guide/navigation/modals#passing-data) 1. [From parent to modal](https://docs.nativescript.org/guide/navigation/modals#from-parent-to-modal) 2. [From modal to parent](https://docs.nativescript.org/guide/navigation/modals#from-modal-to-parent) 5. [Additional Resources](https://docs.nativescript.org/guide/navigation/modals#additional-resources) ## Adding Native Code NativeScript provides direct access to all native APIs as well as cross-platform capabilities through [@nativescript/core](https://docs.nativescript.org/core/#nativescript-core), [third party plugins](https://market.nativescript.org/) or [@nativescript/\* plugins](https://docs.nativescript.org/plugins). Additionally, you can easily add custom native files directly to your project and use them immediately from TypeScript. Ever since [NativeScript 8.8](https://blog.nativescript.org/nativescript-8-8-announcement/#ns-native), you can use a single command to add platform language files and have them auto configured ready to use with: ```bash ns native add swift AwesomeClass # Swift file 'nativescript-project/App_Resources/iOS/src/AwesomeClass.swift' generated successfully. ns native add objective-c OtherAwesomeClass # Module map 'nativescript-project/App_Resources/iOS/src/module.modulemap' has been updated with the header 'OtherAwesomeClass.h'. ns native add kotlin com.company.AwesomeClass # Kotlin file 'nativescript-project/App_Resources/Android/src/main/java/com/company/AwesomeClass.kt' generated successfully. ns native add java com.company.OtherAwesomeClass # Java file 'nativescript-project/App_Resources/Android/src/main/java/com/company/OtherAwesomeClass.java' generated successfully. ``` 1. You can also manually add native code to [App\_Resources](https://docs.nativescript.org/project-structure/app-resources): - [Adding Java/Kotlin code to an application](https://docs.nativescript.org/guide/native-code/android) - [Adding ObjectiveC/Swift Code to an application](https://docs.nativescript.org/guide/native-code/ios) 2. Optionally [generate TypeScript types for the added APIs](https://docs.nativescript.org/guide/native-code/generate-typings) Additionally, NativeScript also supports Jetpack Compose and SwiftUI through plugins. 1. [Jetpack Compose Plugin](https://docs.nativescript.org/plugins/jetpack-compose) - [Jetpack Compose Introduction and example](https://dev.to/valorsoftware/introduction-to-jetpack-compose-for-nativescript-54d7) 2. [SwiftUI Plugin](https://docs.nativescript.org/plugins/swift-ui) - [SwiftUI Introduction and example](https://dev.to/valorsoftware/introduction-to-swiftui-for-nativescript-4m1b) ## Progress Component Represents a progress component. ## Summary [​](https://docs.nativescript.org/api/class/Progress\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/Progress#constructor) #### Properties [android](https://docs.nativescript.org/api/class/Progress#android)[ios](https://docs.nativescript.org/api/class/Progress#ios)[maxValue](https://docs.nativescript.org/api/class/Progress#maxvalue)[value](https://docs.nativescript.org/api/class/Progress#value) ## Constructors [​](https://docs.nativescript.org/api/class/Progress\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/Progress\#constructor) ``` new Progress(): Progress ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[Progress](https://docs.nativescript.org/api/class/Progress)_ ## Properties [​](https://docs.nativescript.org/api/class/Progress\#properties) ### android [​](https://docs.nativescript.org/api/class/Progress\#android) ``` android: any ``` defined in [@nativescript/core/ui/progress/index.d.ts:11:1](https://unpkg.com/browse/@nativescript/core//ui/progress/index.d.ts#L11) Gets the native \[android widget\](http://developer.android.com/reference/android/widget/ProgressBar.html) that represents the user interface for this component. Valid only when running on Android OS. ### ios [​](https://docs.nativescript.org/api/class/Progress\#ios) ``` ios: any ``` defined in [@nativescript/core/ui/progress/index.d.ts:16:1](https://unpkg.com/browse/@nativescript/core//ui/progress/index.d.ts#L16) Gets the native iOS \[UIProgressView\](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIProgressView\_Class/) that represents the user interface for this component. Valid only when running on iOS. ### maxValue [​](https://docs.nativescript.org/api/class/Progress\#maxvalue) ``` maxValue: number ``` defined in [@nativescript/core/ui/progress/index.d.ts:26:1](https://unpkg.com/browse/@nativescript/core//ui/progress/index.d.ts#L26) Gets or sets a progress max value. ### value [​](https://docs.nativescript.org/api/class/Progress\#value) ``` value: number ``` defined in [@nativescript/core/ui/progress/index.d.ts:21:1](https://unpkg.com/browse/@nativescript/core//ui/progress/index.d.ts#L21) Gets or sets a progress current value. 2. [Summary](https://docs.nativescript.org/api/class/Progress#summary) 3. [Constructors](https://docs.nativescript.org/api/class/Progress#constructors) 1. [constructor](https://docs.nativescript.org/api/class/Progress#constructor) 4. [Properties](https://docs.nativescript.org/api/class/Progress#properties) 1. [android](https://docs.nativescript.org/api/class/Progress#android) 2. [ios](https://docs.nativescript.org/api/class/Progress#ios) 3. [maxValue](https://docs.nativescript.org/api/class/Progress#maxvalue) 4. [value](https://docs.nativescript.org/api/class/Progress#value) ## NativeScript PageBase Class [ContentView](https://docs.nativescript.org/api/class/ContentView) PageBase [Page](https://docs.nativescript.org/api/class/Page) ## Summary [​](https://docs.nativescript.org/api/class/PageBase\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/PageBase#constructor) #### Properties [\_frame](https://docs.nativescript.org/api/class/PageBase#frame)[accessibilityAnnouncePageEnabled](https://docs.nativescript.org/api/class/PageBase#accessibilityannouncepageenabled)[actionBarHidden](https://docs.nativescript.org/api/class/PageBase#actionbarhidden)[backgroundSpanUnderStatusBar](https://docs.nativescript.org/api/class/PageBase#backgroundspanunderstatusbar)[enableSwipeBackNavigation](https://docs.nativescript.org/api/class/PageBase#enableswipebacknavigation)[hasActionBar](https://docs.nativescript.org/api/class/PageBase#hasactionbar)[navigatedFromEvent](https://docs.nativescript.org/api/class/PageBase#navigatedfromevent)[navigatedToEvent](https://docs.nativescript.org/api/class/PageBase#navigatedtoevent)[navigatingFromEvent](https://docs.nativescript.org/api/class/PageBase#navigatingfromevent)[navigatingToEvent](https://docs.nativescript.org/api/class/PageBase#navigatingtoevent) 155 properties inherited from ContentView Click to expand \_androidContentDescriptionUpdated\_automaticallyAdjustsScrollViewInsets\_closeModalCallback\_context\_cssState\_defaultPaddingBottom\_defaultPaddingLeft\_defaultPaddingRight\_defaultPaddingTop\_domId\_ignoreFlexMinWidthHeightReset\_isAddedToNativeVisualTree\_isLayoutValid\_isPaddingRelative\_isStyleScopeHost\_oldBottom\_oldLeft\_oldRight\_oldTop\_styleScope\_suspendNativeUpdatesCountaccessibilityBlurEventaccessibilityFocusChangedEventaccessibilityFocusEventaccessibilityHiddenaccessibilityHintaccessibilityIdentifieraccessibilityLabelaccessibilityLanguageaccessibilityLiveRegionaccessibilityMediaSessionaccessibilityPerformEscapeEventaccessibilityRoleaccessibilityStateaccessibilityValueaccessiblealignSelfandroidandroidDynamicElevationOffsetandroidElevationautomationTextbackgroundbackgroundColorbackgroundImagebindingContextborderBottomColorborderBottomLeftRadiusborderBottomRightRadiusborderBottomWidthborderColorborderLeftColorborderLeftWidthborderRadiusborderRightColorborderRightWidthborderTopColorborderTopLeftRadiusborderTopRightRadiusborderTopWidthborderWidthboxShadowclassNamecolcolorcolSpancolumncolumnSpancontentcreatedEventcssClassescssPseudoClassescssTypedisposeNativeViewEventdockdomNodeeffectiveBorderBottomWidtheffectiveBorderLeftWidtheffectiveBorderRightWidtheffectiveBorderTopWidtheffectiveHeighteffectiveLefteffectiveMarginBottomeffectiveMarginLefteffectiveMarginRighteffectiveMarginTopeffectiveMinHeighteffectiveMinWidtheffectivePaddingBottomeffectivePaddingLefteffectivePaddingRighteffectivePaddingTopeffectiveTopeffectiveWidthflexGrowflexShrinkflexWrapBeforeheighthorizontalAlignmentidignoreTouchAnimationiosiosAccessibilityAdjustsFontSizeiosAccessibilityMaxFontScaleiosAccessibilityMinFontScaleiosIgnoreSafeAreaiosOverflowSafeAreaiosOverflowSafeAreaEnabledisCollapsedisEnabledisLayoutValidisUserInteractionEnabledlayoutChangedEventleftloadedEventmarginmarginBottommarginLeftmarginRightmarginTopminHeightminWidthmodalnativeViewProtectedopacityorderoriginXoriginYparentperspectivepropertyChangeEventrecycleNativeViewreusablerotaterotateXrotateYrowrowSpanscaleXscaleYsharedTransitionIgnoresharedTransitionTagshowingModallyEventshownModallyEventtestIDtoptouchAnimationtouchDelaytransitionIdtranslateXtranslateYunloadedEventverticalAlignmentviewControllervisibilitywidth #### Accessors [\_childrenCount](https://docs.nativescript.org/api/class/PageBase#childrencount)[actionBar](https://docs.nativescript.org/api/class/PageBase#actionbar)[androidStatusBarBackground](https://docs.nativescript.org/api/class/PageBase#androidstatusbarbackground)[frame](https://docs.nativescript.org/api/class/PageBase#frame)[navigationContext](https://docs.nativescript.org/api/class/PageBase#navigationcontext)[page](https://docs.nativescript.org/api/class/PageBase#page)[statusBarStyle](https://docs.nativescript.org/api/class/PageBase#statusbarstyle) 10 accessors inherited from ContentView Click to expand backgroundPositionbackgroundRepeatbackgroundSizeclassisLoadednativeViewparentNodestyletextTransformtypeName #### Methods [\_addChildFromBuilder](https://docs.nativescript.org/api/class/PageBase#addchildfrombuilder)[accessibilityScreenChanged](https://docs.nativescript.org/api/class/PageBase#accessibilityscreenchanged)[eachChildView](https://docs.nativescript.org/api/class/PageBase#eachchildview)[getKeyframeAnimationWithName](https://docs.nativescript.org/api/class/PageBase#getkeyframeanimationwithname)[onNavigatedFrom](https://docs.nativescript.org/api/class/PageBase#onnavigatedfrom)[onNavigatedTo](https://docs.nativescript.org/api/class/PageBase#onnavigatedto)[onNavigatingFrom](https://docs.nativescript.org/api/class/PageBase#onnavigatingfrom)[onNavigatingTo](https://docs.nativescript.org/api/class/PageBase#onnavigatingto) 111 methods inherited from ContentView Click to expand \_addView\_addViewCore\_addViewToNativeVisualTree\_applyXmlAttribute\_batchUpdate\_childIndexToNativeChildIndex\_closeAllModalViewsInternal\_createPropertyChangeData\_dialogClosed\_eachLayoutView\_emit\_getNativeViewsCount\_getRootModalViews\_getValue\_handleLivesync\_hasAncestorView\_hideNativeModalView\_inheritStyleScope\_layoutParent\_observe\_onAttachedToWindow\_onDetachedFromWindow\_onRootViewReset\_onSizeChanged\_parentChanged\_raiseLayoutChangedEvent\_raiseShowingModallyEvent\_raiseShownModallyEvent\_removeView\_removeViewCore\_removeViewFromNativeVisualTree\_resumeNativeUpdates\_setupAsRootView\_setupUI\_setValue\_shouldDelayLayout\_showNativeModalView\_suspendNativeUpdates\_tearDownUI\_updateStyleScopeaccessibilityAnnouncementaddEventListeneraddEventListeneraddPseudoClassanimatebindcallLoadedcallUnloadedcloseModalcombineMeasuredStatescreateAnimationcreateNativeViewdeletePseudoClassdestroyNodedisposeNativeVieweachChildensureDomNodefocusgetgetActualSizegetGestureObserversgetLocationInWindowgetLocationOnScreengetLocationRelativeTogetMeasuredHeightgetMeasuredStategetMeasuredWidthgetSafeAreaInsetsgetViewByDomIdgetViewByIdhasGestureObservershasListenersinitNativeViewlayoutlayoutChildlayoutNativeViewlayoutViewloadViewmeasuremeasureChildnotifynotifyPropertyChangeoffoffonononBackPressedonceonceonLayoutonLoadedonMeasureonResumeNativeUpdatesonUnloadedremoveEventListenerremoveEventListenerrequestLayoutresetNativeViewresolveSizeAndStatesendAccessibilityEventsetsetInlineStylesetMeasuredDimensionsetNativeViewsetOnTouchListenersetPropertysetTestIDshowModaltoStringunbindunloadView ## Constructors [​](https://docs.nativescript.org/api/class/PageBase\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/PageBase\#constructor) ``` new PageBase(): PageBase ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[PageBase](https://docs.nativescript.org/api/class/PageBase)_ ## Properties [​](https://docs.nativescript.org/api/class/PageBase\#properties) ### \_frame [​](https://docs.nativescript.org/api/class/PageBase\#frame) ``` _frame: Frame ``` defined in [@nativescript/core/ui/page/page-common.d.ts:22:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L22) ### accessibilityAnnouncePageEnabled [​](https://docs.nativescript.org/api/class/PageBase\#accessibilityannouncepageenabled) ``` accessibilityAnnouncePageEnabled: boolean ``` defined in [@nativescript/core/ui/page/page-common.d.ts:27:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L27) ### actionBarHidden [​](https://docs.nativescript.org/api/class/PageBase\#actionbarhidden) ``` actionBarHidden: boolean ``` defined in [@nativescript/core/ui/page/page-common.d.ts:23:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L23) ### backgroundSpanUnderStatusBar [​](https://docs.nativescript.org/api/class/PageBase\#backgroundspanunderstatusbar) ``` backgroundSpanUnderStatusBar: boolean ``` defined in [@nativescript/core/ui/page/page-common.d.ts:25:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L25) ### enableSwipeBackNavigation [​](https://docs.nativescript.org/api/class/PageBase\#enableswipebacknavigation) ``` enableSwipeBackNavigation: boolean ``` defined in [@nativescript/core/ui/page/page-common.d.ts:24:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L24) ### hasActionBar [​](https://docs.nativescript.org/api/class/PageBase\#hasactionbar) ``` hasActionBar: boolean ``` defined in [@nativescript/core/ui/page/page-common.d.ts:26:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L26) ### navigatedFromEvent [​](https://docs.nativescript.org/api/class/PageBase\#navigatedfromevent) Static ``` navigatedFromEvent: string ``` defined in [@nativescript/core/ui/page/page-common.d.ts:19:11](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L19) ### navigatedToEvent [​](https://docs.nativescript.org/api/class/PageBase\#navigatedtoevent) Static ``` navigatedToEvent: string ``` defined in [@nativescript/core/ui/page/page-common.d.ts:17:11](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L17) ### navigatingFromEvent [​](https://docs.nativescript.org/api/class/PageBase\#navigatingfromevent) Static ``` navigatingFromEvent: string ``` defined in [@nativescript/core/ui/page/page-common.d.ts:18:11](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L18) ### navigatingToEvent [​](https://docs.nativescript.org/api/class/PageBase\#navigatingtoevent) Static ``` navigatingToEvent: string ``` defined in [@nativescript/core/ui/page/page-common.d.ts:16:11](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L16) ## Accessors [​](https://docs.nativescript.org/api/class/PageBase\#accessors) ### \_childrenCount [​](https://docs.nativescript.org/api/class/PageBase\#childrencount) ``` get _childrenCount(): number ``` defined in [@nativescript/core/ui/page/page-common.d.ts:45:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L45) Returns _number_ ### actionBar [​](https://docs.nativescript.org/api/class/PageBase\#actionbar) ``` get actionBar(): ActionBar ``` defined in [@nativescript/core/ui/page/page-common.d.ts:29:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L29) Returns _[ActionBar](https://docs.nativescript.org/api/class/ActionBar)_ ### androidStatusBarBackground [​](https://docs.nativescript.org/api/class/PageBase\#androidstatusbarbackground) ``` get androidStatusBarBackground(): Color ``` defined in [@nativescript/core/ui/page/page-common.d.ts:33:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L33) Returns _[Color](https://docs.nativescript.org/api/class/Color)_ ### frame [​](https://docs.nativescript.org/api/class/PageBase\#frame-1) ``` get frame(): Frame ``` defined in [@nativescript/core/ui/page/page-common.d.ts:38:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L38) Returns _[Frame](https://docs.nativescript.org/api/class/Frame)_ ### navigationContext [​](https://docs.nativescript.org/api/class/PageBase\#navigationcontext) ``` get navigationContext(): any ``` defined in [@nativescript/core/ui/page/page-common.d.ts:28:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L28) Returns _any_ ### page [​](https://docs.nativescript.org/api/class/PageBase\#page) ``` get page(): Page ``` defined in [@nativescript/core/ui/page/page-common.d.ts:35:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L35) Returns _[Page](https://docs.nativescript.org/api/class/Page)_ ### statusBarStyle [​](https://docs.nativescript.org/api/class/PageBase\#statusbarstyle) ``` get statusBarStyle(): "dark" | "light" ``` defined in [@nativescript/core/ui/page/page-common.d.ts:31:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L31) Returns _"dark" \| "light"_ ## Methods [​](https://docs.nativescript.org/api/class/PageBase\#methods) ### \_addChildFromBuilder [​](https://docs.nativescript.org/api/class/PageBase\#addchildfrombuilder) ``` _addChildFromBuilder(name: string, value: any): void ``` defined in [@nativescript/core/ui/page/page-common.d.ts:36:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L36) | | | | | --- | --- | --- | | Parameter | Default | Description | | `name` | `` | `string` | | `value` | `` | `any` | Returns _void_ ### accessibilityScreenChanged [​](https://docs.nativescript.org/api/class/PageBase\#accessibilityscreenchanged) ``` accessibilityScreenChanged(refocus?: boolean): void ``` defined in [@nativescript/core/ui/page/page-common.d.ts:46:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L46) | | | | | --- | --- | --- | | Parameter | Default | Description | | `refocus` | `` | `boolean` | Returns _void_ ### eachChildView [​](https://docs.nativescript.org/api/class/PageBase\#eachchildview) ``` eachChildView(callback: (child: View) => boolean): void ``` defined in [@nativescript/core/ui/page/page-common.d.ts:44:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L44) | | | | | --- | --- | --- | | Parameter | Default | Description | | `callback` | `` | `(child: View) => boolean` | Returns _void_ ### getKeyframeAnimationWithName [​](https://docs.nativescript.org/api/class/PageBase\#getkeyframeanimationwithname) ``` getKeyframeAnimationWithName(animationName: string): KeyframeAnimationInfo ``` defined in [@nativescript/core/ui/page/page-common.d.ts:37:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L37) | | | | | --- | --- | --- | | Parameter | Default | Description | | `animationName` | `` | `string` | Returns _[KeyframeAnimationInfo](https://docs.nativescript.org/api/class/KeyframeAnimationInfo)_ ### onNavigatedFrom [​](https://docs.nativescript.org/api/class/PageBase\#onnavigatedfrom) ``` onNavigatedFrom(isBackNavigation: boolean): void ``` defined in [@nativescript/core/ui/page/page-common.d.ts:43:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L43) | | | | | --- | --- | --- | | Parameter | Default | Description | | `isBackNavigation` | `` | `boolean` | Returns _void_ ### onNavigatedTo [​](https://docs.nativescript.org/api/class/PageBase\#onnavigatedto) ``` onNavigatedTo(isBackNavigation: boolean): void ``` defined in [@nativescript/core/ui/page/page-common.d.ts:41:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L41) | | | | | --- | --- | --- | | Parameter | Default | Description | | `isBackNavigation` | `` | `boolean` | Returns _void_ ### onNavigatingFrom [​](https://docs.nativescript.org/api/class/PageBase\#onnavigatingfrom) ``` onNavigatingFrom(isBackNavigation: boolean): void ``` defined in [@nativescript/core/ui/page/page-common.d.ts:42:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L42) | | | | | --- | --- | --- | | Parameter | Default | Description | | `isBackNavigation` | `` | `boolean` | Returns _void_ ### onNavigatingTo [​](https://docs.nativescript.org/api/class/PageBase\#onnavigatingto) ``` onNavigatingTo( context: any, isBackNavigation: boolean, bindingContext?: any ): void ``` defined in [@nativescript/core/ui/page/page-common.d.ts:40:4](https://unpkg.com/browse/@nativescript/core//ui/page/page-common.d.ts#L40) | | | | | --- | --- | --- | | Parameter | Default | Description | | `context` | `` | `any` | | `isBackNavigation` | `` | `boolean` | | `bindingContext` | `` | `any` | Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/PageBase#summary) 3. [Constructors](https://docs.nativescript.org/api/class/PageBase#constructors) 1. [constructor](https://docs.nativescript.org/api/class/PageBase#constructor) 4. [Properties](https://docs.nativescript.org/api/class/PageBase#properties) 01. [\_frame](https://docs.nativescript.org/api/class/PageBase#frame) 02. [accessibilityAnnouncePageEnabled](https://docs.nativescript.org/api/class/PageBase#accessibilityannouncepageenabled) 03. [actionBarHidden](https://docs.nativescript.org/api/class/PageBase#actionbarhidden) 04. [backgroundSpanUnderStatusBar](https://docs.nativescript.org/api/class/PageBase#backgroundspanunderstatusbar) 05. [enableSwipeBackNavigation](https://docs.nativescript.org/api/class/PageBase#enableswipebacknavigation) 06. [hasActionBar](https://docs.nativescript.org/api/class/PageBase#hasactionbar) 07. [navigatedFromEvent](https://docs.nativescript.org/api/class/PageBase#navigatedfromevent) 08. [navigatedToEvent](https://docs.nativescript.org/api/class/PageBase#navigatedtoevent) 09. [navigatingFromEvent](https://docs.nativescript.org/api/class/PageBase#navigatingfromevent) 10. [navigatingToEvent](https://docs.nativescript.org/api/class/PageBase#navigatingtoevent) 5. [Accessors](https://docs.nativescript.org/api/class/PageBase#accessors) 1. [\_childrenCount](https://docs.nativescript.org/api/class/PageBase#childrencount) 2. [actionBar](https://docs.nativescript.org/api/class/PageBase#actionbar) 3. [androidStatusBarBackground](https://docs.nativescript.org/api/class/PageBase#androidstatusbarbackground) 4. [frame](https://docs.nativescript.org/api/class/PageBase#frame-1) 5. [navigationContext](https://docs.nativescript.org/api/class/PageBase#navigationcontext) 6. [page](https://docs.nativescript.org/api/class/PageBase#page) 7. [statusBarStyle](https://docs.nativescript.org/api/class/PageBase#statusbarstyle) 6. [Methods](https://docs.nativescript.org/api/class/PageBase#methods) 1. [\_addChildFromBuilder](https://docs.nativescript.org/api/class/PageBase#addchildfrombuilder) 2. [accessibilityScreenChanged](https://docs.nativescript.org/api/class/PageBase#accessibilityscreenchanged) 3. [eachChildView](https://docs.nativescript.org/api/class/PageBase#eachchildview) 4. [getKeyframeAnimationWithName](https://docs.nativescript.org/api/class/PageBase#getkeyframeanimationwithname) 5. [onNavigatedFrom](https://docs.nativescript.org/api/class/PageBase#onnavigatedfrom) 6. [onNavigatedTo](https://docs.nativescript.org/api/class/PageBase#onnavigatedto) 7. [onNavigatingFrom](https://docs.nativescript.org/api/class/PageBase#onnavigatingfrom) 8. [onNavigatingTo](https://docs.nativescript.org/api/class/PageBase#onnavigatingto) ## LayoutBase Class [CustomLayoutView](https://docs.nativescript.org/api/class/CustomLayoutView) LayoutBase [ProxyViewContainer](https://docs.nativescript.org/api/class/ProxyViewContainer) [AbsoluteLayout](https://docs.nativescript.org/api/class/AbsoluteLayout) [DockLayout](https://docs.nativescript.org/api/class/DockLayout) [FlexboxLayout](https://docs.nativescript.org/api/class/FlexboxLayout) [GridLayout](https://docs.nativescript.org/api/class/GridLayout) [StackLayout](https://docs.nativescript.org/api/class/StackLayout) [WrapLayout](https://docs.nativescript.org/api/class/WrapLayout) Base class for all views that supports children positioning. ## Summary [​](https://docs.nativescript.org/api/class/LayoutBase\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/LayoutBase#constructor) #### Properties [clipToBounds](https://docs.nativescript.org/api/class/LayoutBase#cliptobounds)[isPassThroughParentEnabled](https://docs.nativescript.org/api/class/LayoutBase#ispassthroughparentenabled)[padding](https://docs.nativescript.org/api/class/LayoutBase#padding)[paddingBottom](https://docs.nativescript.org/api/class/LayoutBase#paddingbottom)[paddingLeft](https://docs.nativescript.org/api/class/LayoutBase#paddingleft)[paddingRight](https://docs.nativescript.org/api/class/LayoutBase#paddingright)[paddingTop](https://docs.nativescript.org/api/class/LayoutBase#paddingtop) 154 properties inherited from CustomLayoutView Click to expand \_androidContentDescriptionUpdated\_automaticallyAdjustsScrollViewInsets\_closeModalCallback\_context\_cssState\_defaultPaddingBottom\_defaultPaddingLeft\_defaultPaddingRight\_defaultPaddingTop\_domId\_ignoreFlexMinWidthHeightReset\_isAddedToNativeVisualTree\_isLayoutValid\_isPaddingRelative\_isStyleScopeHost\_oldBottom\_oldLeft\_oldRight\_oldTop\_styleScope\_suspendNativeUpdatesCountaccessibilityBlurEventaccessibilityFocusChangedEventaccessibilityFocusEventaccessibilityHiddenaccessibilityHintaccessibilityIdentifieraccessibilityLabelaccessibilityLanguageaccessibilityLiveRegionaccessibilityMediaSessionaccessibilityPerformEscapeEventaccessibilityRoleaccessibilityStateaccessibilityValueaccessiblealignSelfandroidandroidDynamicElevationOffsetandroidElevationautomationTextbackgroundbackgroundColorbackgroundImagebindingContextborderBottomColorborderBottomLeftRadiusborderBottomRightRadiusborderBottomWidthborderColorborderLeftColorborderLeftWidthborderRadiusborderRightColorborderRightWidthborderTopColorborderTopLeftRadiusborderTopRightRadiusborderTopWidthborderWidthboxShadowclassNamecolcolorcolSpancolumncolumnSpancreatedEventcssClassescssPseudoClassescssTypedisposeNativeViewEventdockdomNodeeffectiveBorderBottomWidtheffectiveBorderLeftWidtheffectiveBorderRightWidtheffectiveBorderTopWidtheffectiveHeighteffectiveLefteffectiveMarginBottomeffectiveMarginLefteffectiveMarginRighteffectiveMarginTopeffectiveMinHeighteffectiveMinWidtheffectivePaddingBottomeffectivePaddingLefteffectivePaddingRighteffectivePaddingTopeffectiveTopeffectiveWidthflexGrowflexShrinkflexWrapBeforeheighthorizontalAlignmentidignoreTouchAnimationiosiosAccessibilityAdjustsFontSizeiosAccessibilityMaxFontScaleiosAccessibilityMinFontScaleiosIgnoreSafeAreaiosOverflowSafeAreaiosOverflowSafeAreaEnabledisCollapsedisEnabledisLayoutValidisUserInteractionEnabledlayoutChangedEventleftloadedEventmarginmarginBottommarginLeftmarginRightmarginTopminHeightminWidthmodalnativeViewProtectedopacityorderoriginXoriginYparentperspectivepropertyChangeEventrecycleNativeViewreusablerotaterotateXrotateYrowrowSpanscaleXscaleYsharedTransitionIgnoresharedTransitionTagshowingModallyEventshownModallyEventtestIDtoptouchAnimationtouchDelaytransitionIdtranslateXtranslateYunloadedEventverticalAlignmentviewControllervisibilitywidth #### Methods [\_registerLayoutChild](https://docs.nativescript.org/api/class/LayoutBase#registerlayoutchild)[\_unregisterLayoutChild](https://docs.nativescript.org/api/class/LayoutBase#unregisterlayoutchild)[addChild](https://docs.nativescript.org/api/class/LayoutBase#addchild)[eachLayoutChild](https://docs.nativescript.org/api/class/LayoutBase#eachlayoutchild)[getChildAt](https://docs.nativescript.org/api/class/LayoutBase#getchildat)[getChildIndex](https://docs.nativescript.org/api/class/LayoutBase#getchildindex)[getChildrenCount](https://docs.nativescript.org/api/class/LayoutBase#getchildrencount)[insertChild](https://docs.nativescript.org/api/class/LayoutBase#insertchild)[removeChild](https://docs.nativescript.org/api/class/LayoutBase#removechild)[removeChildren](https://docs.nativescript.org/api/class/LayoutBase#removechildren) 112 methods inherited from CustomLayoutView Click to expand \_addView\_addViewCore\_addViewToNativeVisualTree\_applyXmlAttribute\_batchUpdate\_childIndexToNativeChildIndex\_closeAllModalViewsInternal\_createPropertyChangeData\_dialogClosed\_eachLayoutView\_emit\_getNativeViewsCount\_getRootModalViews\_getValue\_handleLivesync\_hasAncestorView\_hideNativeModalView\_inheritStyleScope\_layoutParent\_observe\_onAttachedToWindow\_onDetachedFromWindow\_onRootViewReset\_onSizeChanged\_parentChanged\_raiseLayoutChangedEvent\_raiseShowingModallyEvent\_raiseShownModallyEvent\_removeView\_removeViewCore\_removeViewFromNativeVisualTree\_resumeNativeUpdates\_setupAsRootView\_setupUI\_setValue\_shouldDelayLayout\_showNativeModalView\_suspendNativeUpdates\_tearDownUI\_updateStyleScopeaccessibilityAnnouncementaccessibilityScreenChangedaddEventListeneraddEventListeneraddPseudoClassanimatebindcallLoadedcallUnloadedcloseModalcombineMeasuredStatescreateAnimationcreateNativeViewdeletePseudoClassdestroyNodedisposeNativeVieweachChildeachChildViewensureDomNodefocusgetgetActualSizegetGestureObserversgetLocationInWindowgetLocationOnScreengetLocationRelativeTogetMeasuredHeightgetMeasuredStategetMeasuredWidthgetSafeAreaInsetsgetViewByDomIdgetViewByIdhasGestureObservershasListenersinitNativeViewlayoutlayoutChildlayoutNativeViewloadViewmeasuremeasureChildnotifynotifyPropertyChangeoffoffonononBackPressedonceonceonLayoutonLoadedonMeasureonResumeNativeUpdatesonUnloadedremoveEventListenerremoveEventListenerrequestLayoutresetNativeViewresolveSizeAndStatesendAccessibilityEventsetsetInlineStylesetMeasuredDimensionsetNativeViewsetOnTouchListenersetPropertysetTestIDshowModaltoStringunbindunloadView ## Constructors [​](https://docs.nativescript.org/api/class/LayoutBase\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/LayoutBase\#constructor) ``` new LayoutBase(): LayoutBase ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[LayoutBase](https://docs.nativescript.org/api/class/LayoutBase)_ ## Properties [​](https://docs.nativescript.org/api/class/LayoutBase\#properties) ### clipToBounds [​](https://docs.nativescript.org/api/class/LayoutBase\#cliptobounds) ``` clipToBounds: boolean ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:94:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L94) Gets or sets a value indicating whether to clip the content of this layout. ### isPassThroughParentEnabled [​](https://docs.nativescript.org/api/class/LayoutBase\#ispassthroughparentenabled) ``` isPassThroughParentEnabled: boolean ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:101:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L101) Gets or sets a value indicating whether touch event should pass through to a parent view of the layout container in case an interactive child view did not handle it. Default value of this property is false. This does not affect the appearance of the view. ### padding [​](https://docs.nativescript.org/api/class/LayoutBase\#padding) ``` padding: string | number | LengthDipUnit | LengthPxUnit ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:69:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L69) Gets or sets padding style property. ### paddingBottom [​](https://docs.nativescript.org/api/class/LayoutBase\#paddingbottom) ``` paddingBottom: LengthType ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:74:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L74) Specify the bottom padding of this layout. ### paddingLeft [​](https://docs.nativescript.org/api/class/LayoutBase\#paddingleft) ``` paddingLeft: LengthType ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:79:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L79) Specify the left padding of this layout. ### paddingRight [​](https://docs.nativescript.org/api/class/LayoutBase\#paddingright) ``` paddingRight: LengthType ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:84:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L84) Specify the right padding of this layout. ### paddingTop [​](https://docs.nativescript.org/api/class/LayoutBase\#paddingtop) ``` paddingTop: LengthType ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:89:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L89) Specify the top padding of this layout. ## Methods [​](https://docs.nativescript.org/api/class/LayoutBase\#methods) ### \_registerLayoutChild [​](https://docs.nativescript.org/api/class/LayoutBase\#registerlayoutchild) ``` _registerLayoutChild(child: View): void ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:53:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L53) INTERNAL. Used by the layout system. | | | | | --- | --- | --- | | Parameter | Default | Description | | `child` | `` | `View` | Returns _void_ ### \_unregisterLayoutChild [​](https://docs.nativescript.org/api/class/LayoutBase\#unregisterlayoutchild) ``` _unregisterLayoutChild(child: View): void ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:58:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L58) INTERNAL. Used by the layout system. | | | | | --- | --- | --- | | Parameter | Default | Description | | `child` | `` | `View` | Returns _void_ ### addChild [​](https://docs.nativescript.org/api/class/LayoutBase\#addchild) ``` addChild(view: View): void ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:30:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L30) Adds the view to children array. | | | | | --- | --- | --- | | Parameter | Default | Description | | `view` | `` | `View`
The view to be added to the end of the children array. | Returns _void_ ### eachLayoutChild [​](https://docs.nativescript.org/api/class/LayoutBase\#eachlayoutchild) ``` eachLayoutChild(callback: (child: View, isLast: boolean) => void): void ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:64:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L64) Calls the callback for each child that should be laid out. | | | | | --- | --- | --- | | Parameter | Default | Description | | `callback` | `` | `(child: View, isLast: boolean) => void`
The callback | Returns _void_ ### getChildAt [​](https://docs.nativescript.org/api/class/LayoutBase\#getchildat) ``` getChildAt(index: number): View ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:18:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L18) Returns the view at the specified position. | | | | | --- | --- | --- | | Parameter | Default | Description | | `index` | `` | `number`
The position at which to get the child from. | Returns _[View](https://docs.nativescript.org/api/class/View)_ ### getChildIndex [​](https://docs.nativescript.org/api/class/LayoutBase\#getchildindex) ``` getChildIndex(child: View): number ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:24:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L24) Returns the position of the child view | | | | | --- | --- | --- | | Parameter | Default | Description | | `child` | `` | `View`
The child view that we are looking for. | Returns _number_ ### getChildrenCount [​](https://docs.nativescript.org/api/class/LayoutBase\#getchildrencount) ``` getChildrenCount(): number ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:12:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L12) Returns the number of children in this Layout. Returns _number_ ### insertChild [​](https://docs.nativescript.org/api/class/LayoutBase\#insertchild) ``` insertChild(child: View, atIndex: number): void ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:37:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L37) Inserts the view to children array at the specified index. | | | | | --- | --- | --- | | Parameter | Default | Description | | `child` | `` | `View` | | `atIndex` | `` | `number`
The insertion index. | Returns _void_ ### removeChild [​](https://docs.nativescript.org/api/class/LayoutBase\#removechild) ``` removeChild(view: View): void ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:43:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L43) Removes the specified view from the children array. | | | | | --- | --- | --- | | Parameter | Default | Description | | `view` | `` | `View`
The view to remove from the children array. | Returns _void_ ### removeChildren [​](https://docs.nativescript.org/api/class/LayoutBase\#removechildren) ``` removeChildren(): void ``` defined in [@nativescript/core/ui/layouts/layout-base.d.ts:48:1](https://unpkg.com/browse/@nativescript/core//ui/layouts/layout-base.d.ts#L48) Removes all views in this layout. Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/LayoutBase#summary) 3. [Constructors](https://docs.nativescript.org/api/class/LayoutBase#constructors) 1. [constructor](https://docs.nativescript.org/api/class/LayoutBase#constructor) 4. [Properties](https://docs.nativescript.org/api/class/LayoutBase#properties) 1. [clipToBounds](https://docs.nativescript.org/api/class/LayoutBase#cliptobounds) 2. [isPassThroughParentEnabled](https://docs.nativescript.org/api/class/LayoutBase#ispassthroughparentenabled) 3. [padding](https://docs.nativescript.org/api/class/LayoutBase#padding) 4. [paddingBottom](https://docs.nativescript.org/api/class/LayoutBase#paddingbottom) 5. [paddingLeft](https://docs.nativescript.org/api/class/LayoutBase#paddingleft) 6. [paddingRight](https://docs.nativescript.org/api/class/LayoutBase#paddingright) 7. [paddingTop](https://docs.nativescript.org/api/class/LayoutBase#paddingtop) 5. [Methods](https://docs.nativescript.org/api/class/LayoutBase#methods) 01. [\_registerLayoutChild](https://docs.nativescript.org/api/class/LayoutBase#registerlayoutchild) 02. [\_unregisterLayoutChild](https://docs.nativescript.org/api/class/LayoutBase#unregisterlayoutchild) 03. [addChild](https://docs.nativescript.org/api/class/LayoutBase#addchild) 04. [eachLayoutChild](https://docs.nativescript.org/api/class/LayoutBase#eachlayoutchild) 05. [getChildAt](https://docs.nativescript.org/api/class/LayoutBase#getchildat) 06. [getChildIndex](https://docs.nativescript.org/api/class/LayoutBase#getchildindex) 07. [getChildrenCount](https://docs.nativescript.org/api/class/LayoutBase#getchildrencount) 08. [insertChild](https://docs.nativescript.org/api/class/LayoutBase#insertchild) 09. [removeChild](https://docs.nativescript.org/api/class/LayoutBase#removechild) 10. [removeChildren](https://docs.nativescript.org/api/class/LayoutBase#removechildren) ## Inherited CSS Property [CssProperty](https://docs.nativescript.org/api/class/CssProperty) InheritedCssProperty ## Summary [​](https://docs.nativescript.org/api/class/InheritedCssProperty\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/InheritedCssProperty#constructor) #### Properties [setInheritedValue](https://docs.nativescript.org/api/class/InheritedCssProperty#setinheritedvalue) 13 properties inherited from CssProperty Click to expand cssLocalNamecssNamecssValueDescriptordefaultValuedefaultValueKeygetDefaultisStylePropertykeylocalValueDescriptornameoverrideHandlerssetNativesourceKey ## Constructors [​](https://docs.nativescript.org/api/class/InheritedCssProperty\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/InheritedCssProperty\#constructor) ``` new InheritedCssProperty(options: CssPropertyOptions): InheritedCssProperty ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:119:4](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L119) | | | | | --- | --- | --- | | Parameter | Default | Description | | `options` | `` | `CssPropertyOptions` | Returns _[InheritedCssProperty](https://docs.nativescript.org/api/class/InheritedCssProperty) _ ## Properties [​](https://docs.nativescript.org/api/class/InheritedCssProperty\#properties) ### setInheritedValue [​](https://docs.nativescript.org/api/class/InheritedCssProperty\#setinheritedvalue) ``` setInheritedValue: (value: U) => void ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:118:4](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L118) 2. [Summary](https://docs.nativescript.org/api/class/InheritedCssProperty#summary) 3. [Constructors](https://docs.nativescript.org/api/class/InheritedCssProperty#constructors) 1. [constructor](https://docs.nativescript.org/api/class/InheritedCssProperty#constructor) 4. [Properties](https://docs.nativescript.org/api/class/InheritedCssProperty#properties) 1. [setInheritedValue](https://docs.nativescript.org/api/class/InheritedCssProperty#setinheritedvalue) ## ContentView Class Overview [CustomLayoutView](https://docs.nativescript.org/api/class/CustomLayoutView) ContentView [PageBase](https://docs.nativescript.org/api/class/PageBase) [ScrollView](https://docs.nativescript.org/api/class/ScrollView) ## Summary [​](https://docs.nativescript.org/api/class/ContentView\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/ContentView#constructor) #### Properties [content](https://docs.nativescript.org/api/class/ContentView#content) 154 properties inherited from CustomLayoutView Click to expand \_androidContentDescriptionUpdated\_automaticallyAdjustsScrollViewInsets\_closeModalCallback\_context\_cssState\_defaultPaddingBottom\_defaultPaddingLeft\_defaultPaddingRight\_defaultPaddingTop\_domId\_ignoreFlexMinWidthHeightReset\_isAddedToNativeVisualTree\_isLayoutValid\_isPaddingRelative\_isStyleScopeHost\_oldBottom\_oldLeft\_oldRight\_oldTop\_styleScope\_suspendNativeUpdatesCountaccessibilityBlurEventaccessibilityFocusChangedEventaccessibilityFocusEventaccessibilityHiddenaccessibilityHintaccessibilityIdentifieraccessibilityLabelaccessibilityLanguageaccessibilityLiveRegionaccessibilityMediaSessionaccessibilityPerformEscapeEventaccessibilityRoleaccessibilityStateaccessibilityValueaccessiblealignSelfandroidandroidDynamicElevationOffsetandroidElevationautomationTextbackgroundbackgroundColorbackgroundImagebindingContextborderBottomColorborderBottomLeftRadiusborderBottomRightRadiusborderBottomWidthborderColorborderLeftColorborderLeftWidthborderRadiusborderRightColorborderRightWidthborderTopColorborderTopLeftRadiusborderTopRightRadiusborderTopWidthborderWidthboxShadowclassNamecolcolorcolSpancolumncolumnSpancreatedEventcssClassescssPseudoClassescssTypedisposeNativeViewEventdockdomNodeeffectiveBorderBottomWidtheffectiveBorderLeftWidtheffectiveBorderRightWidtheffectiveBorderTopWidtheffectiveHeighteffectiveLefteffectiveMarginBottomeffectiveMarginLefteffectiveMarginRighteffectiveMarginTopeffectiveMinHeighteffectiveMinWidtheffectivePaddingBottomeffectivePaddingLefteffectivePaddingRighteffectivePaddingTopeffectiveTopeffectiveWidthflexGrowflexShrinkflexWrapBeforeheighthorizontalAlignmentidignoreTouchAnimationiosiosAccessibilityAdjustsFontSizeiosAccessibilityMaxFontScaleiosAccessibilityMinFontScaleiosIgnoreSafeAreaiosOverflowSafeAreaiosOverflowSafeAreaEnabledisCollapsedisEnabledisLayoutValidisUserInteractionEnabledlayoutChangedEventleftloadedEventmarginmarginBottommarginLeftmarginRightmarginTopminHeightminWidthmodalnativeViewProtectedopacityorderoriginXoriginYparentperspectivepropertyChangeEventrecycleNativeViewreusablerotaterotateXrotateYrowrowSpanscaleXscaleYsharedTransitionIgnoresharedTransitionTagshowingModallyEventshownModallyEventtestIDtoptouchAnimationtouchDelaytransitionIdtranslateXtranslateYunloadedEventverticalAlignmentviewControllervisibilitywidth #### Methods [\_addChildFromBuilder](https://docs.nativescript.org/api/class/ContentView#addchildfrombuilder)[layoutView](https://docs.nativescript.org/api/class/ContentView#layoutview) 112 methods inherited from CustomLayoutView Click to expand \_addView\_addViewCore\_addViewToNativeVisualTree\_applyXmlAttribute\_batchUpdate\_childIndexToNativeChildIndex\_closeAllModalViewsInternal\_createPropertyChangeData\_dialogClosed\_eachLayoutView\_emit\_getNativeViewsCount\_getRootModalViews\_getValue\_handleLivesync\_hasAncestorView\_hideNativeModalView\_inheritStyleScope\_layoutParent\_observe\_onAttachedToWindow\_onDetachedFromWindow\_onRootViewReset\_onSizeChanged\_parentChanged\_raiseLayoutChangedEvent\_raiseShowingModallyEvent\_raiseShownModallyEvent\_removeView\_removeViewCore\_removeViewFromNativeVisualTree\_resumeNativeUpdates\_setupAsRootView\_setupUI\_setValue\_shouldDelayLayout\_showNativeModalView\_suspendNativeUpdates\_tearDownUI\_updateStyleScopeaccessibilityAnnouncementaccessibilityScreenChangedaddEventListeneraddEventListeneraddPseudoClassanimatebindcallLoadedcallUnloadedcloseModalcombineMeasuredStatescreateAnimationcreateNativeViewdeletePseudoClassdestroyNodedisposeNativeVieweachChildeachChildViewensureDomNodefocusgetgetActualSizegetGestureObserversgetLocationInWindowgetLocationOnScreengetLocationRelativeTogetMeasuredHeightgetMeasuredStategetMeasuredWidthgetSafeAreaInsetsgetViewByDomIdgetViewByIdhasGestureObservershasListenersinitNativeViewlayoutlayoutChildlayoutNativeViewloadViewmeasuremeasureChildnotifynotifyPropertyChangeoffoffonononBackPressedonceonceonLayoutonLoadedonMeasureonResumeNativeUpdatesonUnloadedremoveEventListenerremoveEventListenerrequestLayoutresetNativeViewresolveSizeAndStatesendAccessibilityEventsetsetInlineStylesetMeasuredDimensionsetNativeViewsetOnTouchListenersetPropertysetTestIDshowModaltoStringunbindunloadView ## Constructors [​](https://docs.nativescript.org/api/class/ContentView\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/ContentView\#constructor) ``` new ContentView(): ContentView ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[ContentView](https://docs.nativescript.org/api/class/ContentView)_ ## Properties [​](https://docs.nativescript.org/api/class/ContentView\#properties) ### content [​](https://docs.nativescript.org/api/class/ContentView\#content) ``` content: View ``` defined in [@nativescript/core/ui/content-view/index.d.ts:4:1](https://unpkg.com/browse/@nativescript/core//ui/content-view/index.d.ts#L4) ## Methods [​](https://docs.nativescript.org/api/class/ContentView\#methods) ### \_addChildFromBuilder [​](https://docs.nativescript.org/api/class/ContentView\#addchildfrombuilder) ``` _addChildFromBuilder(name: string, value: any): void ``` defined in [@nativescript/core/ui/content-view/index.d.ts:6:1](https://unpkg.com/browse/@nativescript/core//ui/content-view/index.d.ts#L6) | | | | | --- | --- | --- | | Parameter | Default | Description | | `name` | `` | `string` | | `value` | `` | `any` | Returns _void_ ### layoutView [​](https://docs.nativescript.org/api/class/ContentView\#layoutview) ``` layoutView(): View ``` defined in [@nativescript/core/ui/content-view/index.d.ts:5:1](https://unpkg.com/browse/@nativescript/core//ui/content-view/index.d.ts#L5) Returns _[View](https://docs.nativescript.org/api/class/View)_ 2. [Summary](https://docs.nativescript.org/api/class/ContentView#summary) 3. [Constructors](https://docs.nativescript.org/api/class/ContentView#constructors) 1. [constructor](https://docs.nativescript.org/api/class/ContentView#constructor) 4. [Properties](https://docs.nativescript.org/api/class/ContentView#properties) 1. [content](https://docs.nativescript.org/api/class/ContentView#content) 5. [Methods](https://docs.nativescript.org/api/class/ContentView#methods) 1. [\_addChildFromBuilder](https://docs.nativescript.org/api/class/ContentView#addchildfrombuilder) 2. [layoutView](https://docs.nativescript.org/api/class/ContentView#layoutview) ## CssProperty Class Overview CssProperty [InheritedCssProperty](https://docs.nativescript.org/api/class/InheritedCssProperty) ## Summary [​](https://docs.nativescript.org/api/class/CssProperty\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/CssProperty#constructor) #### Properties [cssLocalName](https://docs.nativescript.org/api/class/CssProperty#csslocalname)[cssName](https://docs.nativescript.org/api/class/CssProperty#cssname)[cssValueDescriptor](https://docs.nativescript.org/api/class/CssProperty#cssvaluedescriptor)[defaultValue](https://docs.nativescript.org/api/class/CssProperty#defaultvalue)[defaultValueKey](https://docs.nativescript.org/api/class/CssProperty#defaultvaluekey)[getDefault](https://docs.nativescript.org/api/class/CssProperty#getdefault)[isStyleProperty](https://docs.nativescript.org/api/class/CssProperty#isstyleproperty)[key](https://docs.nativescript.org/api/class/CssProperty#key)[localValueDescriptor](https://docs.nativescript.org/api/class/CssProperty#localvaluedescriptor)[name](https://docs.nativescript.org/api/class/CssProperty#name)[overrideHandlers](https://docs.nativescript.org/api/class/CssProperty#overridehandlers)[setNative](https://docs.nativescript.org/api/class/CssProperty#setnative)[sourceKey](https://docs.nativescript.org/api/class/CssProperty#sourcekey) #### Methods [isSet](https://docs.nativescript.org/api/class/CssProperty#isset)[register](https://docs.nativescript.org/api/class/CssProperty#register) ## Constructors [​](https://docs.nativescript.org/api/class/CssProperty\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/CssProperty\#constructor) ``` new CssProperty(options: CssPropertyOptions): CssProperty ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:88:4](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L88) | | | | | --- | --- | --- | | Parameter | Default | Description | | `options` | `` | `CssPropertyOptions` | Returns _[CssProperty](https://docs.nativescript.org/api/class/CssProperty) _ ## Properties [​](https://docs.nativescript.org/api/class/CssProperty\#properties) ### cssLocalName [​](https://docs.nativescript.org/api/class/CssProperty\#csslocalname) Readonly ``` cssLocalName: string ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:77:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L77) ### cssName [​](https://docs.nativescript.org/api/class/CssProperty\#cssname) Readonly ``` cssName: string ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:76:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L76) ### cssValueDescriptor [​](https://docs.nativescript.org/api/class/CssProperty\#cssvaluedescriptor) ProtectedReadonly ``` cssValueDescriptor: PropertyDescriptor ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:78:23](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L78) ### defaultValue [​](https://docs.nativescript.org/api/class/CssProperty\#defaultvalue) Readonly ``` defaultValue: U ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:86:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L86) ### defaultValueKey [​](https://docs.nativescript.org/api/class/CssProperty\#defaultvaluekey) Readonly ``` defaultValueKey: symbol ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:85:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L85) ### getDefault [​](https://docs.nativescript.org/api/class/CssProperty\#getdefault) Readonly ``` getDefault: symbol ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:82:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L82) ### isStyleProperty [​](https://docs.nativescript.org/api/class/CssProperty\#isstyleproperty) ``` isStyleProperty: boolean ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:80:4](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L80) ### key [​](https://docs.nativescript.org/api/class/CssProperty\#key) Readonly ``` key: symbol ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:81:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L81) ### localValueDescriptor [​](https://docs.nativescript.org/api/class/CssProperty\#localvaluedescriptor) ProtectedReadonly ``` localValueDescriptor: PropertyDescriptor ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:79:23](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L79) ### name [​](https://docs.nativescript.org/api/class/CssProperty\#name) Readonly ``` name: string ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:75:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L75) ### overrideHandlers [​](https://docs.nativescript.org/api/class/CssProperty\#overridehandlers) ``` overrideHandlers: (options: CssPropertyOptions<T, U>) => void ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:87:4](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L87) ### setNative [​](https://docs.nativescript.org/api/class/CssProperty\#setnative) Readonly ``` setNative: symbol ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:83:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L83) ### sourceKey [​](https://docs.nativescript.org/api/class/CssProperty\#sourcekey) Readonly ``` sourceKey: symbol ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:84:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L84) ## Methods [​](https://docs.nativescript.org/api/class/CssProperty\#methods) ### isSet [​](https://docs.nativescript.org/api/class/CssProperty\#isset) ``` isSet(instance: T): boolean ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:92:4](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L92) | | | | | --- | --- | --- | | Parameter | Default | Description | | `instance` | `` | `T` | Returns _boolean_ ### register [​](https://docs.nativescript.org/api/class/CssProperty\#register) ``` register(cls: {}): void ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:89:4](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L89) | | | | | --- | --- | --- | | Parameter | Default | Description | | `cls` | `` | `{}` | Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/CssProperty#summary) 3. [Constructors](https://docs.nativescript.org/api/class/CssProperty#constructors) 1. [constructor](https://docs.nativescript.org/api/class/CssProperty#constructor) 4. [Properties](https://docs.nativescript.org/api/class/CssProperty#properties) 01. [cssLocalName](https://docs.nativescript.org/api/class/CssProperty#csslocalname) 02. [cssName](https://docs.nativescript.org/api/class/CssProperty#cssname) 03. [cssValueDescriptor](https://docs.nativescript.org/api/class/CssProperty#cssvaluedescriptor) 04. [defaultValue](https://docs.nativescript.org/api/class/CssProperty#defaultvalue) 05. [defaultValueKey](https://docs.nativescript.org/api/class/CssProperty#defaultvaluekey) 06. [getDefault](https://docs.nativescript.org/api/class/CssProperty#getdefault) 07. [isStyleProperty](https://docs.nativescript.org/api/class/CssProperty#isstyleproperty) 08. [key](https://docs.nativescript.org/api/class/CssProperty#key) 09. [localValueDescriptor](https://docs.nativescript.org/api/class/CssProperty#localvaluedescriptor) 10. [name](https://docs.nativescript.org/api/class/CssProperty#name) 11. [overrideHandlers](https://docs.nativescript.org/api/class/CssProperty#overridehandlers) 12. [setNative](https://docs.nativescript.org/api/class/CssProperty#setnative) 13. [sourceKey](https://docs.nativescript.org/api/class/CssProperty#sourcekey) 5. [Methods](https://docs.nativescript.org/api/class/CssProperty#methods) 1. [isSet](https://docs.nativescript.org/api/class/CssProperty#isset) 2. [register](https://docs.nativescript.org/api/class/CssProperty#register) ## AndroidApplication Class [ApplicationCommon](https://docs.nativescript.org/api/class/ApplicationCommon) AndroidApplication ## Summary [​](https://docs.nativescript.org/api/class/AndroidApplication\#summary) #### Properties [activityBackPressedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitybackpressedevent)[activityBackPressedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitybackpressedevent-1)[activityCreatedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitycreatedevent)[activityCreatedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitycreatedevent-1)[activityDestroyedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitydestroyedevent)[activityDestroyedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitydestroyedevent-1)[activityNewIntentEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitynewintentevent)[activityNewIntentEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitynewintentevent-1)[activityPausedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitypausedevent)[activityPausedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitypausedevent-1)[activityRequestPermissionsEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityrequestpermissionsevent)[activityRequestPermissionsEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityrequestpermissionsevent-1)[activityResultEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityresultevent)[activityResultEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityresultevent-1)[activityResumedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityresumedevent)[activityResumedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityresumedevent-1)[activityStartedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitystartedevent)[activityStartedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitystartedevent-1)[activityStoppedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitystoppedevent)[activityStoppedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitystoppedevent-1)[saveActivityStateEvent](https://docs.nativescript.org/api/class/AndroidApplication#saveactivitystateevent)[saveActivityStateEvent](https://docs.nativescript.org/api/class/AndroidApplication#saveactivitystateevent-1) 28 properties inherited from [ApplicationCommon](https://docs.nativescript.org/api/class/ApplicationCommon) Click to expand [autoSystemAppearanceChanged](https://docs.nativescript.org/api/class/ApplicationCommon#autosystemappearancechanged)[backgroundEvent](https://docs.nativescript.org/api/class/ApplicationCommon#backgroundevent)[cssChangedEvent](https://docs.nativescript.org/api/class/ApplicationCommon#csschangedevent)[discardedErrorEvent](https://docs.nativescript.org/api/class/ApplicationCommon#discardederrorevent)[displayedEvent](https://docs.nativescript.org/api/class/ApplicationCommon#displayedevent)[exitEvent](https://docs.nativescript.org/api/class/ApplicationCommon#exitevent)[fontScaleChangedEvent](https://docs.nativescript.org/api/class/ApplicationCommon#fontscalechangedevent)[foregroundEvent](https://docs.nativescript.org/api/class/ApplicationCommon#foregroundevent)[hasListeners](https://docs.nativescript.org/api/class/ApplicationCommon#haslisteners)[hasListeners](https://docs.nativescript.org/api/class/ApplicationCommon#haslisteners-1)[launchEvent](https://docs.nativescript.org/api/class/ApplicationCommon#launchevent)[livesyncEvent](https://docs.nativescript.org/api/class/ApplicationCommon#livesyncevent)[loadAppCssEvent](https://docs.nativescript.org/api/class/ApplicationCommon#loadappcssevent)[lowMemoryEvent](https://docs.nativescript.org/api/class/ApplicationCommon#lowmemoryevent)[mainEntry](https://docs.nativescript.org/api/class/ApplicationCommon#mainentry)[notify](https://docs.nativescript.org/api/class/ApplicationCommon#notify)[notify](https://docs.nativescript.org/api/class/ApplicationCommon#notify-1)[off](https://docs.nativescript.org/api/class/ApplicationCommon#off)[off](https://docs.nativescript.org/api/class/ApplicationCommon#off-1)[on](https://docs.nativescript.org/api/class/ApplicationCommon#on-1)[once](https://docs.nativescript.org/api/class/ApplicationCommon#once)[once](https://docs.nativescript.org/api/class/ApplicationCommon#once-1)[orientationChangedEvent](https://docs.nativescript.org/api/class/ApplicationCommon#orientationchangedevent)[resumeEvent](https://docs.nativescript.org/api/class/ApplicationCommon#resumeevent)[started](https://docs.nativescript.org/api/class/ApplicationCommon#started)[suspendEvent](https://docs.nativescript.org/api/class/ApplicationCommon#suspendevent)[systemAppearanceChangedEvent](https://docs.nativescript.org/api/class/ApplicationCommon#systemappearancechangedevent)[uncaughtErrorEvent](https://docs.nativescript.org/api/class/ApplicationCommon#uncaughterrorevent) #### Accessors [backgrounded](https://docs.nativescript.org/api/class/AndroidApplication#backgrounded)[context](https://docs.nativescript.org/api/class/AndroidApplication#context)[foregroundActivity](https://docs.nativescript.org/api/class/AndroidApplication#foregroundactivity)[nativeApp](https://docs.nativescript.org/api/class/AndroidApplication#nativeapp)[packageName](https://docs.nativescript.org/api/class/AndroidApplication#packagename)[paused](https://docs.nativescript.org/api/class/AndroidApplication#paused)[startActivity](https://docs.nativescript.org/api/class/AndroidApplication#startactivity) 6 accessors inherited from [ApplicationCommon](https://docs.nativescript.org/api/class/ApplicationCommon) Click to expand androidAndroidApplicationinBackgroundiosiOSApplicationsuspended #### Methods [getNativeApplication](https://docs.nativescript.org/api/class/AndroidApplication#getnativeapplication)[getRegisteredBroadcastReceiver](https://docs.nativescript.org/api/class/AndroidApplication#getregisteredbroadcastreceiver)[on](https://docs.nativescript.org/api/class/AndroidApplication#on-1)[registerBroadcastReceiver](https://docs.nativescript.org/api/class/AndroidApplication#registerbroadcastreceiver)[unregisterBroadcastReceiver](https://docs.nativescript.org/api/class/AndroidApplication#unregisterbroadcastreceiver) 27 methods inherited from [ApplicationCommon](https://docs.nativescript.org/api/class/ApplicationCommon) Click to expand [addCss](https://docs.nativescript.org/api/class/ApplicationCommon#addcss)[applyCssClass](https://docs.nativescript.org/api/class/ApplicationCommon#applycssclass)[createRootView](https://docs.nativescript.org/api/class/ApplicationCommon#createrootview)[getCssFileName](https://docs.nativescript.org/api/class/ApplicationCommon#getcssfilename)[getMainEntry](https://docs.nativescript.org/api/class/ApplicationCommon#getmainentry)[getOrientation](https://docs.nativescript.org/api/class/ApplicationCommon#getorientation)[getResources](https://docs.nativescript.org/api/class/ApplicationCommon#getresources)[getRootView](https://docs.nativescript.org/api/class/ApplicationCommon#getrootview)[getSystemAppearance](https://docs.nativescript.org/api/class/ApplicationCommon#getsystemappearance)[hasLaunched](https://docs.nativescript.org/api/class/ApplicationCommon#haslaunched)[initRootView](https://docs.nativescript.org/api/class/ApplicationCommon#initrootview)[loadAppCss](https://docs.nativescript.org/api/class/ApplicationCommon#loadappcss)[notifyLaunch](https://docs.nativescript.org/api/class/ApplicationCommon#notifylaunch)[orientation](https://docs.nativescript.org/api/class/ApplicationCommon#orientation)[orientationChanged](https://docs.nativescript.org/api/class/ApplicationCommon#orientationchanged)[resetRootView](https://docs.nativescript.org/api/class/ApplicationCommon#resetrootview)[run](https://docs.nativescript.org/api/class/ApplicationCommon#run)[setAutoSystemAppearanceChanged](https://docs.nativescript.org/api/class/ApplicationCommon#setautosystemappearancechanged)[setCssFileName](https://docs.nativescript.org/api/class/ApplicationCommon#setcssfilename)[setInBackground](https://docs.nativescript.org/api/class/ApplicationCommon#setinbackground)[setMaxRefreshRate](https://docs.nativescript.org/api/class/ApplicationCommon#setmaxrefreshrate)[setOrientation](https://docs.nativescript.org/api/class/ApplicationCommon#setorientation)[setResources](https://docs.nativescript.org/api/class/ApplicationCommon#setresources)[setSuspended](https://docs.nativescript.org/api/class/ApplicationCommon#setsuspended)[setSystemAppearance](https://docs.nativescript.org/api/class/ApplicationCommon#setsystemappearance)[systemAppearance](https://docs.nativescript.org/api/class/ApplicationCommon#systemappearance)[systemAppearanceChanged](https://docs.nativescript.org/api/class/ApplicationCommon#systemappearancechanged) ## Properties [​](https://docs.nativescript.org/api/class/AndroidApplication\#properties) ### activityBackPressedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitybackpressedevent) Readonly ``` activityBackPressedEvent: "activityBackPressed" = AndroidApplication.activityBackPressedEvent ``` defined in [@nativescript/core/application/application.d.ts:62:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L62) ### activityCreatedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitycreatedevent) Readonly ``` activityCreatedEvent: "activityCreated" = AndroidApplication.activityCreatedEvent ``` defined in [@nativescript/core/application/application.d.ts:54:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L54) ### activityDestroyedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitydestroyedevent) Readonly ``` activityDestroyedEvent: "activityDestroyed" = AndroidApplication.activityDestroyedEvent ``` defined in [@nativescript/core/application/application.d.ts:55:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L55) ### activityNewIntentEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitynewintentevent) Readonly ``` activityNewIntentEvent: "activityNewIntent" = AndroidApplication.activityNewIntentEvent ``` defined in [@nativescript/core/application/application.d.ts:63:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L63) ### activityPausedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitypausedevent) Readonly ``` activityPausedEvent: "activityPaused" = AndroidApplication.activityPausedEvent ``` defined in [@nativescript/core/application/application.d.ts:57:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L57) ### activityRequestPermissionsEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activityrequestpermissionsevent) Readonly ``` activityRequestPermissionsEvent: "activityRequestPermissions" = AndroidApplication.activityRequestPermissionsEvent ``` defined in [@nativescript/core/application/application.d.ts:64:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L64) ### activityResultEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activityresultevent) Readonly ``` activityResultEvent: "activityResult" = AndroidApplication.activityResultEvent ``` defined in [@nativescript/core/application/application.d.ts:61:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L61) ### activityResumedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activityresumedevent) Readonly ``` activityResumedEvent: "activityResumed" = AndroidApplication.activityResumedEvent ``` defined in [@nativescript/core/application/application.d.ts:58:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L58) ### activityStartedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitystartedevent) Readonly ``` activityStartedEvent: "activityStarted" = AndroidApplication.activityStartedEvent ``` defined in [@nativescript/core/application/application.d.ts:56:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L56) ### activityStoppedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitystoppedevent) Readonly ``` activityStoppedEvent: "activityStopped" = AndroidApplication.activityStoppedEvent ``` defined in [@nativescript/core/application/application.d.ts:59:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L59) ### saveActivityStateEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#saveactivitystateevent) Readonly ``` saveActivityStateEvent: "saveActivityState" = AndroidApplication.saveActivityStateEvent ``` defined in [@nativescript/core/application/application.d.ts:60:10](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L60) ### activityBackPressedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitybackpressedevent-1) StaticReadonly ``` activityBackPressedEvent: "activityBackPressed" = 'activityBackPressed' ``` defined in [@nativescript/core/application/application.d.ts:44:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L44) ### activityCreatedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitycreatedevent-1) StaticReadonly ``` activityCreatedEvent: "activityCreated" = 'activityCreated' ``` defined in [@nativescript/core/application/application.d.ts:12:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L12) ### activityDestroyedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitydestroyedevent-1) StaticReadonly ``` activityDestroyedEvent: "activityDestroyed" = 'activityDestroyed' ``` defined in [@nativescript/core/application/application.d.ts:16:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L16) ### activityNewIntentEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitynewintentevent-1) StaticReadonly ``` activityNewIntentEvent: "activityNewIntent" = 'activityNewIntent' ``` defined in [@nativescript/core/application/application.d.ts:48:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L48) ### activityPausedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitypausedevent-1) StaticReadonly ``` activityPausedEvent: "activityPaused" = 'activityPaused' ``` defined in [@nativescript/core/application/application.d.ts:24:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L24) ### activityRequestPermissionsEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activityrequestpermissionsevent-1) StaticReadonly ``` activityRequestPermissionsEvent: "activityRequestPermissions" = 'activityRequestPermissions' ``` defined in [@nativescript/core/application/application.d.ts:52:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L52) ### activityResultEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activityresultevent-1) StaticReadonly ``` activityResultEvent: "activityResult" = 'activityResult' ``` defined in [@nativescript/core/application/application.d.ts:40:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L40) ### activityResumedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activityresumedevent-1) StaticReadonly ``` activityResumedEvent: "activityResumed" = 'activityResumed' ``` defined in [@nativescript/core/application/application.d.ts:28:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L28) ### activityStartedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitystartedevent-1) StaticReadonly ``` activityStartedEvent: "activityStarted" = 'activityStarted' ``` defined in [@nativescript/core/application/application.d.ts:20:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L20) ### activityStoppedEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#activitystoppedevent-1) StaticReadonly ``` activityStoppedEvent: "activityStopped" = 'activityStopped' ``` defined in [@nativescript/core/application/application.d.ts:32:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L32) ### saveActivityStateEvent [​](https://docs.nativescript.org/api/class/AndroidApplication\#saveactivitystateevent-1) StaticReadonly ``` saveActivityStateEvent: "saveActivityState" = 'saveActivityState' ``` defined in [@nativescript/core/application/application.d.ts:36:17](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L36) ## Accessors [​](https://docs.nativescript.org/api/class/AndroidApplication\#accessors) ### backgrounded [​](https://docs.nativescript.org/api/class/AndroidApplication\#backgrounded) ``` get backgrounded(): boolean ``` defined in [@nativescript/core/application/application.d.ts:103:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L103) Returns _boolean_ ### context [​](https://docs.nativescript.org/api/class/AndroidApplication\#context) ``` get context(): Context ``` defined in [@nativescript/core/application/application.d.ts:98:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L98) Returns _Context_ ### foregroundActivity [​](https://docs.nativescript.org/api/class/AndroidApplication\#foregroundactivity) ``` get foregroundActivity(): AppCompatActivity ``` defined in [@nativescript/core/application/application.d.ts:93:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L93) The currently active (loaded) \[android Activity\](http://developer.android.com/reference/android/app/Activity.html). This property is automatically updated upon Activity events. Returns _AppCompatActivity_ ### nativeApp [​](https://docs.nativescript.org/api/class/AndroidApplication\#nativeapp) ``` get nativeApp(): Application ``` defined in [@nativescript/core/application/application.d.ts:76:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L76) The \[android Application\](http://developer.android.com/reference/android/app/Application.html) object instance provided to the init of the module. Returns _Application_ ### packageName [​](https://docs.nativescript.org/api/class/AndroidApplication\#packagename) ``` get packageName(): string ``` defined in [@nativescript/core/application/application.d.ts:81:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L81) Returns _string_ ### paused [​](https://docs.nativescript.org/api/class/AndroidApplication\#paused) ``` get paused(): boolean ``` defined in [@nativescript/core/application/application.d.ts:108:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L108) Returns _boolean_ ### startActivity [​](https://docs.nativescript.org/api/class/AndroidApplication\#startactivity) ``` get startActivity(): AppCompatActivity ``` defined in [@nativescript/core/application/application.d.ts:86:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L86) The main (start) Activity for the application. Returns _AppCompatActivity_ ## Methods [​](https://docs.nativescript.org/api/class/AndroidApplication\#methods) ### getNativeApplication [​](https://docs.nativescript.org/api/class/AndroidApplication\#getnativeapplication) ``` getNativeApplication(): Application ``` defined in [@nativescript/core/application/application.d.ts:66:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L66) Returns _Application_ ### getRegisteredBroadcastReceiver [​](https://docs.nativescript.org/api/class/AndroidApplication\#getregisteredbroadcastreceiver) ``` getRegisteredBroadcastReceiver(intentFilter: string): BroadcastReceiver ``` defined in [@nativescript/core/application/application.d.ts:129:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L129) Get a registered BroadcastReceiver, then you can get the result code of BroadcastReceiver in onReceiveCallback method. | | | | | --- | --- | --- | | Parameter | Default | Description | | `intentFilter` | `` | `string`
A string containing the intent filter. | Returns _BroadcastReceiver_ ### on [​](https://docs.nativescript.org/api/class/AndroidApplication\#on) ``` on( event: "activityCreated", callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:131:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L131) | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"activityCreated"` | | `callback` | `` | `(args: AndroidActivityBundleEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on( event: "activityDestroyed", callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:132:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L132) This event is raised when application css is changed. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"activityDestroyed"` | | `callback` | `` | `(args: AndroidActivityEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on( event: "activityStarted", callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:133:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L133) Event raised then livesync operation is performed. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"activityStarted"` | | `callback` | `` | `(args: AndroidActivityEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on( event: "activityPaused", callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:134:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L134) This event is raised when application css is changed. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"activityPaused"` | | `callback` | `` | `(args: AndroidActivityEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on( event: "activityResumed", callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:135:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L135) This event is raised on application launchEvent. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"activityResumed"` | | `callback` | `` | `(args: AndroidActivityEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on( event: "activityStopped", callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:136:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L136) This event is raised after the application has performed most of its startup actions. Its intent is to be suitable for measuring app startup times. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"activityStopped"` | | `callback` | `` | `(args: AndroidActivityEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on( event: "saveActivityState", callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:137:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L137) This event is raised when the Application is suspended. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"saveActivityState"` | | `callback` | `` | `(args: AndroidActivityBundleEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on( event: "activityResult", callback: (args: AndroidActivityResultEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:138:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L138) This event is raised when the Application is resumed after it has been suspended. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"activityResult"` | | `callback` | `` | `(args: AndroidActivityResultEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on( event: "activityBackPressed", callback: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:139:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L139) This event is raised when the Application is about to exit. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"activityBackPressed"` | | `callback` | `` | `(args: AndroidActivityBackPressedEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on( event: "activityNewIntent", callback: (args: AndroidActivityNewIntentEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:140:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L140) This event is raised when there is low memory on the target device. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"activityNewIntent"` | | `callback` | `` | `(args: AndroidActivityNewIntentEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on( event: "activityRequestPermissions", callback: (args: AndroidActivityRequestPermissionsEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/application/application.d.ts:141:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L141) This event is raised when an uncaught error occurs while the application is running. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"activityRequestPermissions"` | | `callback` | `` | `(args: AndroidActivityRequestPermissionsEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ### registerBroadcastReceiver [​](https://docs.nativescript.org/api/class/AndroidApplication\#registerbroadcastreceiver) ``` registerBroadcastReceiver( intentFilter: string, onReceiveCallback: (context: Context, intent: Intent) => void ): void ``` defined in [@nativescript/core/application/application.d.ts:116:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L116) Register a BroadcastReceiver to be run in the main activity thread. The receiver will be called with any broadcast Intent that matches filter, in the main application thread. For more information, please visit 'http://developer.android.com/reference/android/content/Context.html#registerReceiver%28android.content.BroadcastReceiver,%20android.content.IntentFilter%29' | | | | | --- | --- | --- | | Parameter | Default | Description | | `intentFilter` | `` | `string`
A string containing the intent filter. | | `onReceiveCallback` | `` | `(context: Context, intent: Intent) => void`
A callback function that will be called each time the receiver receives a broadcast. | Returns _void_ ### unregisterBroadcastReceiver [​](https://docs.nativescript.org/api/class/AndroidApplication\#unregisterbroadcastreceiver) ``` unregisterBroadcastReceiver(intentFilter: string): void ``` defined in [@nativescript/core/application/application.d.ts:123:1](https://unpkg.com/browse/@nativescript/core//application/application.d.ts#L123) Unregister a previously registered BroadcastReceiver. For more information, please visit 'http://developer.android.com/reference/android/content/Context.html#unregisterReceiver(android.content.BroadcastReceiver)' | | | | | --- | --- | --- | | Parameter | Default | Description | | `intentFilter` | `` | `string`
A string containing the intent filter with which the receiver was originally registered. | Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/AndroidApplication#summary) 3. [Properties](https://docs.nativescript.org/api/class/AndroidApplication#properties) 01. [activityBackPressedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitybackpressedevent) 02. [activityCreatedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitycreatedevent) 03. [activityDestroyedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitydestroyedevent) 04. [activityNewIntentEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitynewintentevent) 05. [activityPausedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitypausedevent) 06. [activityRequestPermissionsEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityrequestpermissionsevent) 07. [activityResultEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityresultevent) 08. [activityResumedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityresumedevent) 09. [activityStartedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitystartedevent) 10. [activityStoppedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitystoppedevent) 11. [saveActivityStateEvent](https://docs.nativescript.org/api/class/AndroidApplication#saveactivitystateevent) 12. [activityBackPressedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitybackpressedevent-1) 13. [activityCreatedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitycreatedevent-1) 14. [activityDestroyedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitydestroyedevent-1) 15. [activityNewIntentEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitynewintentevent-1) 16. [activityPausedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitypausedevent-1) 17. [activityRequestPermissionsEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityrequestpermissionsevent-1) 18. [activityResultEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityresultevent-1) 19. [activityResumedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activityresumedevent-1) 20. [activityStartedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitystartedevent-1) 21. [activityStoppedEvent](https://docs.nativescript.org/api/class/AndroidApplication#activitystoppedevent-1) 22. [saveActivityStateEvent](https://docs.nativescript.org/api/class/AndroidApplication#saveactivitystateevent-1) 4. [Accessors](https://docs.nativescript.org/api/class/AndroidApplication#accessors) 1. [backgrounded](https://docs.nativescript.org/api/class/AndroidApplication#backgrounded) 2. [context](https://docs.nativescript.org/api/class/AndroidApplication#context) 3. [foregroundActivity](https://docs.nativescript.org/api/class/AndroidApplication#foregroundactivity) 4. [nativeApp](https://docs.nativescript.org/api/class/AndroidApplication#nativeapp) 5. [packageName](https://docs.nativescript.org/api/class/AndroidApplication#packagename) 6. [paused](https://docs.nativescript.org/api/class/AndroidApplication#paused) 7. [startActivity](https://docs.nativescript.org/api/class/AndroidApplication#startactivity) 5. [Methods](https://docs.nativescript.org/api/class/AndroidApplication#methods) 1. [getNativeApplication](https://docs.nativescript.org/api/class/AndroidApplication#getnativeapplication) 2. [getRegisteredBroadcastReceiver](https://docs.nativescript.org/api/class/AndroidApplication#getregisteredbroadcastreceiver) 3. [on](https://docs.nativescript.org/api/class/AndroidApplication#on) 4. [registerBroadcastReceiver](https://docs.nativescript.org/api/class/AndroidApplication#registerbroadcastreceiver) 5. [unregisterBroadcastReceiver](https://docs.nativescript.org/api/class/AndroidApplication#unregisterbroadcastreceiver) ## Image Asset Class [Observable](https://docs.nativescript.org/api/class/Observable) ImageAsset Observable is used when you want to be notified when a change occurs. Use on/off methods to add/remove listener. Please note that should you be using the `` `new Observable({})` `` constructor, it is \*\*obsolete\*\* since v3.0, and you have to migrate to the "data/observable" `` `fromObject({})` `` or the `` `fromObjectRecursive({})` `` functions. ## Summary [​](https://docs.nativescript.org/api/class/ImageAsset\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/ImageAsset#constructor) #### Properties [android](https://docs.nativescript.org/api/class/ImageAsset#android)[ios](https://docs.nativescript.org/api/class/ImageAsset#ios)[nativeImage](https://docs.nativescript.org/api/class/ImageAsset#nativeimage)[options](https://docs.nativescript.org/api/class/ImageAsset#options) 1 properties inherited from [Observable](https://docs.nativescript.org/api/class/Observable) Click to expand [propertyChangeEvent](https://docs.nativescript.org/api/class/Observable#propertychangeevent) #### Methods [getImageAsync](https://docs.nativescript.org/api/class/ImageAsset#getimageasync) 18 methods inherited from [Observable](https://docs.nativescript.org/api/class/Observable) Click to expand [\_createPropertyChangeData](https://docs.nativescript.org/api/class/Observable#createpropertychangedata)[\_emit](https://docs.nativescript.org/api/class/Observable#emit)[addEventListener](https://docs.nativescript.org/api/class/Observable#addeventlistener)[addEventListener](https://docs.nativescript.org/api/class/Observable#addeventlistener-2)[get](https://docs.nativescript.org/api/class/Observable#get)[hasListeners](https://docs.nativescript.org/api/class/Observable#haslisteners)[notify](https://docs.nativescript.org/api/class/Observable#notify)[notifyPropertyChange](https://docs.nativescript.org/api/class/Observable#notifypropertychange)[off](https://docs.nativescript.org/api/class/Observable#off)[off](https://docs.nativescript.org/api/class/Observable#off-2)[on](https://docs.nativescript.org/api/class/Observable#on)[on](https://docs.nativescript.org/api/class/Observable#on-2)[once](https://docs.nativescript.org/api/class/Observable#once)[once](https://docs.nativescript.org/api/class/Observable#once-2)[removeEventListener](https://docs.nativescript.org/api/class/Observable#removeeventlistener)[removeEventListener](https://docs.nativescript.org/api/class/Observable#removeeventlistener-2)[set](https://docs.nativescript.org/api/class/Observable#set)[setProperty](https://docs.nativescript.org/api/class/Observable#setproperty) ## Constructors [​](https://docs.nativescript.org/api/class/ImageAsset\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/ImageAsset\#constructor) ``` new ImageAsset(asset: any): ImageAsset ``` defined in [@nativescript/core/image-asset/index.d.ts:4:1](https://unpkg.com/browse/@nativescript/core//image-asset/index.d.ts#L4) | | | | | --- | --- | --- | | Parameter | Default | Description | | `asset` | `` | `any` | Returns _[ImageAsset](https://docs.nativescript.org/api/class/ImageAsset)_ ## Properties [​](https://docs.nativescript.org/api/class/ImageAsset\#properties) ### android [​](https://docs.nativescript.org/api/class/ImageAsset\#android) ``` android: any ``` defined in [@nativescript/core/image-asset/index.d.ts:8:1](https://unpkg.com/browse/@nativescript/core//image-asset/index.d.ts#L8) ### ios [​](https://docs.nativescript.org/api/class/ImageAsset\#ios) ``` ios: any ``` defined in [@nativescript/core/image-asset/index.d.ts:6:1](https://unpkg.com/browse/@nativescript/core//image-asset/index.d.ts#L6) ### nativeImage [​](https://docs.nativescript.org/api/class/ImageAsset\#nativeimage) ``` nativeImage: any ``` defined in [@nativescript/core/image-asset/index.d.ts:7:1](https://unpkg.com/browse/@nativescript/core//image-asset/index.d.ts#L7) ### options [​](https://docs.nativescript.org/api/class/ImageAsset\#options) ``` options: ImageAssetOptions ``` defined in [@nativescript/core/image-asset/index.d.ts:9:1](https://unpkg.com/browse/@nativescript/core//image-asset/index.d.ts#L9) ## Methods [​](https://docs.nativescript.org/api/class/ImageAsset\#methods) ### getImageAsync [​](https://docs.nativescript.org/api/class/ImageAsset\#getimageasync) ``` getImageAsync(callback: (image: any, error: any) => void): any ``` defined in [@nativescript/core/image-asset/index.d.ts:5:1](https://unpkg.com/browse/@nativescript/core//image-asset/index.d.ts#L5) | | | | | --- | --- | --- | | Parameter | Default | Description | | `callback` | `` | `(image: any, error: any) => void` | Returns _any_ 2. [Summary](https://docs.nativescript.org/api/class/ImageAsset#summary) 3. [Constructors](https://docs.nativescript.org/api/class/ImageAsset#constructors) 1. [constructor](https://docs.nativescript.org/api/class/ImageAsset#constructor) 4. [Properties](https://docs.nativescript.org/api/class/ImageAsset#properties) 1. [android](https://docs.nativescript.org/api/class/ImageAsset#android) 2. [ios](https://docs.nativescript.org/api/class/ImageAsset#ios) 3. [nativeImage](https://docs.nativescript.org/api/class/ImageAsset#nativeimage) 4. [options](https://docs.nativescript.org/api/class/ImageAsset#options) 5. [Methods](https://docs.nativescript.org/api/class/ImageAsset#methods) 1. [getImageAsync](https://docs.nativescript.org/api/class/ImageAsset#getimageasync) ## Shared Element Transitions SharedTransition Shared Element Transitions (preview) Allows you to auto animate between shared elements on two different screesn to create smooth navigational experiences. View components can define sharedTransitionTag="name" alone with a transition through this API. ## Summary [​](https://docs.nativescript.org/api/class/SharedTransition\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/SharedTransition#constructor) #### Properties [DEBUG](https://docs.nativescript.org/api/class/SharedTransition#debug)[finishedEvent](https://docs.nativescript.org/api/class/SharedTransition#finishedevent)[inProgress](https://docs.nativescript.org/api/class/SharedTransition#inprogress)[interactiveCancelledEvent](https://docs.nativescript.org/api/class/SharedTransition#interactivecancelledevent)[interactiveUpdateEvent](https://docs.nativescript.org/api/class/SharedTransition#interactiveupdateevent)[startedEvent](https://docs.nativescript.org/api/class/SharedTransition#startedevent) #### Methods [custom](https://docs.nativescript.org/api/class/SharedTransition#custom)[events](https://docs.nativescript.org/api/class/SharedTransition#events)[finishState](https://docs.nativescript.org/api/class/SharedTransition#finishstate)[getSharedElements](https://docs.nativescript.org/api/class/SharedTransition#getsharedelements)[getState](https://docs.nativescript.org/api/class/SharedTransition#getstate)[notifyEvent](https://docs.nativescript.org/api/class/SharedTransition#notifyevent)[updateState](https://docs.nativescript.org/api/class/SharedTransition#updatestate) ## Constructors [​](https://docs.nativescript.org/api/class/SharedTransition\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/SharedTransition\#constructor) ``` new SharedTransition(): SharedTransition ``` Returns _[SharedTransition](https://docs.nativescript.org/api/class/SharedTransition)_ ## Properties [​](https://docs.nativescript.org/api/class/SharedTransition\#properties) ### DEBUG [​](https://docs.nativescript.org/api/class/SharedTransition\#debug) Static ``` DEBUG: boolean ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:208:11](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L208) Enable to see various console logging output of Shared Element Transition behavior. ### finishedEvent [​](https://docs.nativescript.org/api/class/SharedTransition\#finishedevent) Static ``` finishedEvent: string ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:188:11](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L188) When the transition finishes. ### inProgress [​](https://docs.nativescript.org/api/class/SharedTransition\#inprogress) Static ``` inProgress: boolean ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:175:11](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L175) Whether a transition is in progress or not. Note: used internally however exposed in case custom state ordering is needed. Updated when transitions start/end/cancel. ### interactiveCancelledEvent [​](https://docs.nativescript.org/api/class/SharedTransition\#interactivecancelledevent) Static ``` interactiveCancelledEvent: string ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:192:11](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L192) When the interactive transition cancels. ### interactiveUpdateEvent [​](https://docs.nativescript.org/api/class/SharedTransition\#interactiveupdateevent) Static ``` interactiveUpdateEvent: string ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:196:11](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L196) When the interactive transition updates with the percent value. ### startedEvent [​](https://docs.nativescript.org/api/class/SharedTransition\#startedevent) Static ``` startedEvent: string ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:184:11](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L184) When the transition starts. ## Methods [​](https://docs.nativescript.org/api/class/SharedTransition\#methods) ### custom [​](https://docs.nativescript.org/api/class/SharedTransition\#custom) Static ``` custom(transition: Transition, options?: SharedTransitionConfig): {} ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:167:4](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L167) Configure a custom transition with presentation/dismissal options. | | | | | --- | --- | --- | | Parameter | Default | Description | | `transition` | `` | `Transition`
The custom Transition instance. | | `options` | `` | `SharedTransitionConfig` | Returns _{}_ ### events [​](https://docs.nativescript.org/api/class/SharedTransition\#events) Static ``` events(): SharedTransitionObservable ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:180:4](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L180) Listen to various shared element transition events. Returns _SharedTransitionObservable_ ### finishState [​](https://docs.nativescript.org/api/class/SharedTransition\#finishstate) Static ``` finishState(id: number): void ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:224:4](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L224) Finish transition state. | | | | | --- | --- | --- | | Parameter | Default | Description | | `id` | `` | `number`
Transition instance id | Returns _void_ ### getSharedElements [​](https://docs.nativescript.org/api/class/SharedTransition\#getsharedelements) Static ``` getSharedElements(fromPage: ViewBase, toPage: ViewBase): { presented: View[]; presenting: View[]; } ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:231:4](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L231) Gather view collections based on sharedTransitionTag details. | | | | | --- | --- | --- | | Parameter | Default | Description | | `fromPage` | `` | `ViewBase`
Page moving away from | | `toPage` | `` | `ViewBase`
Page moving to | Returns _{_ _presented: [View](https://docs.nativescript.org/api/class/View)\[\];_ _presenting: [View](https://docs.nativescript.org/api/class/View)\[\];_ _}_ ### getState [​](https://docs.nativescript.org/api/class/SharedTransition\#getstate) Static ``` getState(id: number): SharedTransitionState ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:219:4](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L219) Get current state for any transition. | | | | | --- | --- | --- | | Parameter | Default | Description | | `id` | `` | `number`
Transition instance id | Returns _SharedTransitionState_ ### notifyEvent [​](https://docs.nativescript.org/api/class/SharedTransition\#notifyevent) Static ``` notifyEvent(eventName: string, data: SharedTransitionEventDataPayload): void ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:204:4](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L204) Notify a Shared Transition event. | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventName` | `` | `string`
Shared Transition event name | | `data` | `` | `SharedTransitionEventDataPayload` | Returns _void_ ### updateState [​](https://docs.nativescript.org/api/class/SharedTransition\#updatestate) Static ``` updateState(id: number, state: SharedTransitionState): void ``` defined in [@nativescript/core/ui/transition/shared-transition.d.ts:214:4](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition.d.ts#L214) Update transition state. | | | | | --- | --- | --- | | Parameter | Default | Description | | `id` | `` | `number`
Transition instance id | | `state` | `` | `SharedTransitionState`
SharedTransitionState | Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/SharedTransition#summary) 3. [Constructors](https://docs.nativescript.org/api/class/SharedTransition#constructors) 1. [constructor](https://docs.nativescript.org/api/class/SharedTransition#constructor) 4. [Properties](https://docs.nativescript.org/api/class/SharedTransition#properties) 1. [DEBUG](https://docs.nativescript.org/api/class/SharedTransition#debug) 2. [finishedEvent](https://docs.nativescript.org/api/class/SharedTransition#finishedevent) 3. [inProgress](https://docs.nativescript.org/api/class/SharedTransition#inprogress) 4. [interactiveCancelledEvent](https://docs.nativescript.org/api/class/SharedTransition#interactivecancelledevent) 5. [interactiveUpdateEvent](https://docs.nativescript.org/api/class/SharedTransition#interactiveupdateevent) 6. [startedEvent](https://docs.nativescript.org/api/class/SharedTransition#startedevent) 5. [Methods](https://docs.nativescript.org/api/class/SharedTransition#methods) 1. [custom](https://docs.nativescript.org/api/class/SharedTransition#custom) 2. [events](https://docs.nativescript.org/api/class/SharedTransition#events) 3. [finishState](https://docs.nativescript.org/api/class/SharedTransition#finishstate) 4. [getSharedElements](https://docs.nativescript.org/api/class/SharedTransition#getsharedelements) 5. [getState](https://docs.nativescript.org/api/class/SharedTransition#getstate) 6. [notifyEvent](https://docs.nativescript.org/api/class/SharedTransition#notifyevent) 7. [updateState](https://docs.nativescript.org/api/class/SharedTransition#updatestate) ## Keyframe Animation Info KeyframeAnimationInfo Defines animation options for the View.animate method. ## Summary [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#constructor) #### Properties [curve](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#curve)[delay](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#delay)[duration](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#duration)[isForwards](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#isforwards)[isReverse](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#isreverse)[iterations](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#iterations)[keyframes](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#keyframes)[name](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#name) ## Constructors [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#constructor) ``` new KeyframeAnimationInfo(): KeyframeAnimationInfo ``` Returns _[KeyframeAnimationInfo](https://docs.nativescript.org/api/class/KeyframeAnimationInfo)_ ## Properties [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#properties) ### curve [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#curve) ``` curve?: any ``` defined in [@nativescript/core/ui/animation/keyframe-animation.d.ts:77:1](https://unpkg.com/browse/@nativescript/core//ui/animation/keyframe-animation.d.ts#L77) An optional animation curve. Possible values are contained in the \[AnimationCurve enumeration\](../modules/\_ui\_enums\_.animationcurve.html). Alternatively, you can pass an instance of type UIViewAnimationCurve for iOS or android.animation.TimeInterpolator for Android. ### delay [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#delay) ``` delay?: number ``` defined in [@nativescript/core/ui/animation/keyframe-animation.d.ts:64:1](https://unpkg.com/browse/@nativescript/core//ui/animation/keyframe-animation.d.ts#L64) The amount of time, in milliseconds, to delay starting the animation. ### duration [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#duration) ``` duration?: number ``` defined in [@nativescript/core/ui/animation/keyframe-animation.d.ts:59:1](https://unpkg.com/browse/@nativescript/core//ui/animation/keyframe-animation.d.ts#L59) The length of the animation in milliseconds. The default duration is 300 milliseconds. ### isForwards [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#isforwards) ``` isForwards: boolean ``` defined in [@nativescript/core/ui/animation/keyframe-animation.d.ts:82:1](https://unpkg.com/browse/@nativescript/core//ui/animation/keyframe-animation.d.ts#L82) Determines whether the animation values will be applied on the animated object after the animation finishes. ### isReverse [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#isreverse) ``` isReverse?: boolean ``` defined in [@nativescript/core/ui/animation/keyframe-animation.d.ts:87:1](https://unpkg.com/browse/@nativescript/core//ui/animation/keyframe-animation.d.ts#L87) If true the animation will be played backwards. ### iterations [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#iterations) ``` iterations?: number ``` defined in [@nativescript/core/ui/animation/keyframe-animation.d.ts:71:1](https://unpkg.com/browse/@nativescript/core//ui/animation/keyframe-animation.d.ts#L71) Specifies how many times the animation should be played. Default is 1. iOS animations support fractional iterations, i.e. 1.5. To repeat an animation infinitely, use Number.POSITIVE\_INFINITY ### keyframes [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#keyframes) ``` keyframes: KeyframeInfo[] ``` defined in [@nativescript/core/ui/animation/keyframe-animation.d.ts:49:1](https://unpkg.com/browse/@nativescript/core//ui/animation/keyframe-animation.d.ts#L49) Return animation keyframes. ### name [​](https://docs.nativescript.org/api/class/KeyframeAnimationInfo\#name) ``` name?: string ``` defined in [@nativescript/core/ui/animation/keyframe-animation.d.ts:54:1](https://unpkg.com/browse/@nativescript/core//ui/animation/keyframe-animation.d.ts#L54) The animation name. 2. [Summary](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#summary) 3. [Constructors](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#constructors) 1. [constructor](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#constructor) 4. [Properties](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#properties) 1. [curve](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#curve) 2. [delay](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#delay) 3. [duration](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#duration) 4. [isForwards](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#isforwards) 5. [isReverse](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#isreverse) 6. [iterations](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#iterations) 7. [keyframes](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#keyframes) 8. [name](https://docs.nativescript.org/api/class/KeyframeAnimationInfo#name) # NativeScript UI ListView [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#nativescript-ui-listview) Note This documentation is a current WIP item being migrated from previous documentation. You can access the [documentation being migrated here](https://github.com/NativeScript/docs/tree/master/docs/ui/components/RadListView). ## Overview [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#overview) The **NativeScript UI ListView** plugin is a virtualizing list component that provides the most popular features associated with scenarios where a list of items is used. All these features are embedded in one control with the idea to save developer time and provide better experience. The main features include: - Item animations - Different layouts and orientations - Smart defaults for many gestures - select on long press, execution of special action on swipe, reorder of items on long press and drag, refreshing the list on swipe or loading more items only when needed. ![](https://docs.nativescript.org/assets/list-view-overview_1.fbfb5622.png)![](https://docs.nativescript.org/assets/list-view-overview_2.a43e6b2e.png) ## Installation [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#installation) In Command prompt / Terminal navigate to your application root folder and run: ```bash npm install nativescript-ui-listview ``` ## Features [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#features) Different Layouts RadListView supports three different item layout strategies that are commonly used on mobile apps: list - items are stacked - either horizontally or vertically, depending on the scrolling orientation. grid - items are arranged in columns or rows - depending on the scrolling orientation. staggered grid - items are ordered in a staggered grid formation - either in rows or columns, depending on the scrolling orientation. ![](https://docs.nativescript.org/assets/list-view-overview_3.e78fd6c3.png) All layouts are virtualized and optimized for mobile devices. ### Selection [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#selection) RadListView for NativeScript exposes API allowing you to enable item selection and track selection changes. When using the selection mechanism, two selection modes are available: - Single selection - Multiple selection RadListView also exposes convenient API for programmatically selecting or deselecting items and acquiring the currently selected items. The following methods are exposed by RadListView to manage selection: - `selectAll()` \- selects all available items in the data source - `deselectAll()` \- deselects all currently selected items from the data source - `selectItemAt(index)` \- selects the item at the specified index - `deselectItemAt(index)` \- deselects the item at the specified index if selected - `isItemSelected(item)` \- determines whether the provided item is selected - `getSelectedItems()` \- returns an array of the items currently selected #### Enabling Selection in RadListView [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#enabling-selection-in-radlistview) The value of the `selectionBehavior` property determines how the item selection works. It accepts the values from the `ListViewSelectionBehavior` enumeration: - ListViewSelectionBehavior.None - items cannot be selected - ListViewSelectionBehavior.Press - items are selected by tapping on them - ListViewSelectionBehavior.LongPress - items are selected by holding them Additionally, the value of the `multipleSelection` property determines which selection mode will be used. The available options are: - _multiple selection mode_ \- allows for selecting multiple items. `RadListView` keeps track of which items are selected and exposes them through a `getSelectedItems()` method. Multiple selection is enabled by setting the `multipleSelection` property to `true`. - _single selection mode_ \- only one item can be selected at a time. This mode is enabled by setting the `multipleSelection` property to `false`. #### Enabling multiple selection on RadListView in XML [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#enabling-multiple-selection-on-radlistview-in-xml) #### Handling Selection Events [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#handling-selection-events) To notify you when the selection state of an item is changed, RadListView exposes the following events: - `itemSelecting` \- fired before an item is selected. Can be used to cancel the operation. - `itemSelected` \- fired after an item is successfully selected. At this point the item is already in the selected items array returned by the `getSelectedItems()` method. - `itemDeselecting` \- fired before an item is deselected. Can be used to cancel the operation. - `itemDeselected` \- fired after an item has been successfully deselected. At this point the item is not part of the selected items array returned by the `getSelectedItems()` method. #### Examples [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#examples) #### Single Selection [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#single-selection) /// flavor plain ```xml ``` ```ts export function onItemSelected(args) { const selectedItems = listView.getSelectedItems() let selectedTitles = 'Selected items: ' for (let i = 0; i < selectedItems.length; i++) { selectedTitles += selectedItems[i].itemName if (i < selectedItems.length - 1) { selectedTitles += ', ' } } lblSelection.text = selectedTitles } export function onItemDeselected(args) { const selectedItems = listView.getSelectedItems() let selectedTitles = 'Selected items: ' for (let i = 0; i < selectedItems.length; i++) { selectedTitles += selectedItems[i].itemName if (i < selectedItems.length - 1) { selectedTitles += ', ' } } lblSelection.text = selectedTitles } ``` /// #### Multiple Selection [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#multiple-selection) /// flavor plain ```xml ``` /// #### Programmatic Selection [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#programmatic-selection) /// flavor plain ```xml ``` ```ts export function onPageLoaded(args) { const page = args.object listView = page.getViewById('listView') } export function onSelectItemAtTap(args) { listView.selectItemAt(Number(txtSelectItemIndex.text)) } export function onDeselectItemAtTap(args) { listView.deselectItemAt(Number(txtDeselectItemIndex.text)) } export function onSelectAllTap(args) { listView.selectAll() } export function onDeselectAllTap(args) { listView.deselectAll() } ``` /// ### First Visible Index [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#first-visible-index) `getFirstVisiblePosition()` returns the first visible position the listview. /// flavor plain ```ts import { RadListView } from 'nativescript-ui-listview' let myList: RadListView export function onPageLoaded(args) { const page = args.object as Page myList = page.getViewById('myList') as RadListView } export function getTheFirstVisiblePositionOfTheList() { const firstVisibleIndex = myList.getFirstVisiblePosition() console.log('First visible index:', firstVisibleIndex) } ``` /// ### Horizontal Layout [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#horizontal-layout) /// flavor plain ```xml ``` /// ### Pull to Refresh [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#pull-to-refresh) `pullToRefresh` \- set to `true` to enable pull to refresh functionality. `pullToRefreshInitiated` \- event to initiate your data processing for updating the listview items. /// flavor plain ```xml ``` ```ts import { ListViewEventData } from 'nativescript-ui-listview' async onPullToRefreshInitiated(args: ListViewEventData) { // some operation to fetch more data items from a backend service/API const data = await someHttpCall() if (data) { // add the data to your existing observable array bound to the RLV Items const listView = args.object; listView.notifyPullToRefreshFinished(); } } ``` /// ## Documentation [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#documentation) ## API Reference [​](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view\#api-reference) [Here](https://v7.docs.nativescript.org/ns-ui-api-reference/classes/radlistview) is the API Reference section. 2. [Overview](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view#overview) 3. [Installation](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view#installation) 4. [Features](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view#features) 1. [Selection](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view#selection) 2. [First Visible Index](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view#first-visible-index) 3. [Horizontal Layout](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view#horizontal-layout) 4. [Pull to Refresh](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view#pull-to-refresh) 5. [Documentation](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view#documentation) 6. [API Reference](https://docs.nativescript.org/plugins/nativescript-ui/rad-list-view#api-reference) ## Observable Class Overview Observable [ObservableArray](https://docs.nativescript.org/api/class/ObservableArray) [VirtualArray](https://docs.nativescript.org/api/class/VirtualArray) [ImageAsset](https://docs.nativescript.org/api/class/ImageAsset) [ViewBase](https://docs.nativescript.org/api/class/ViewBase) [ImageCache](https://docs.nativescript.org/api/class/ImageCache) [Style](https://docs.nativescript.org/api/class/Style) Observable is used when you want to be notified when a change occurs. Use on/off methods to add/remove listener. Please note that should you be using the `` `new Observable({})` `` constructor, it is \*\*obsolete\*\* since v3.0, and you have to migrate to the "data/observable" `` `fromObject({})` `` or the `` `fromObjectRecursive({})` `` functions. ## Summary [​](https://docs.nativescript.org/api/class/Observable\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/Observable#constructor) #### Properties [propertyChangeEvent](https://docs.nativescript.org/api/class/Observable#propertychangeevent) #### Methods [\_createPropertyChangeData](https://docs.nativescript.org/api/class/Observable#createpropertychangedata)[\_emit](https://docs.nativescript.org/api/class/Observable#emit)[addEventListener](https://docs.nativescript.org/api/class/Observable#addeventlistener)[addEventListener](https://docs.nativescript.org/api/class/Observable#addeventlistener-2)[get](https://docs.nativescript.org/api/class/Observable#get)[hasListeners](https://docs.nativescript.org/api/class/Observable#haslisteners)[notify](https://docs.nativescript.org/api/class/Observable#notify)[notifyPropertyChange](https://docs.nativescript.org/api/class/Observable#notifypropertychange)[off](https://docs.nativescript.org/api/class/Observable#off)[off](https://docs.nativescript.org/api/class/Observable#off-2)[on](https://docs.nativescript.org/api/class/Observable#on)[on](https://docs.nativescript.org/api/class/Observable#on-2)[once](https://docs.nativescript.org/api/class/Observable#once)[once](https://docs.nativescript.org/api/class/Observable#once-2)[removeEventListener](https://docs.nativescript.org/api/class/Observable#removeeventlistener)[removeEventListener](https://docs.nativescript.org/api/class/Observable#removeeventlistener-2)[set](https://docs.nativescript.org/api/class/Observable#set)[setProperty](https://docs.nativescript.org/api/class/Observable#setproperty) ## Constructors [​](https://docs.nativescript.org/api/class/Observable\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/Observable\#constructor) ``` new Observable(): Observable ``` Returns _[Observable](https://docs.nativescript.org/api/class/Observable)_ ## Properties [​](https://docs.nativescript.org/api/class/Observable\#properties) ### propertyChangeEvent [​](https://docs.nativescript.org/api/class/Observable\#propertychangeevent) Static ``` propertyChangeEvent: string ``` defined in [@nativescript/core/data/observable/index.d.ts:74:11](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L74) String value used when hooking to propertyChange event. ## Methods [​](https://docs.nativescript.org/api/class/Observable\#methods) ### \_createPropertyChangeData [​](https://docs.nativescript.org/api/class/Observable\#createpropertychangedata) ``` _createPropertyChangeData(propertyName: string, value: any, oldValue?: any): PropertyChangeData ``` defined in [@nativescript/core/data/observable/index.d.ts:154:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L154) This method is intended to be overriden by inheritors to provide additional implementation. | | | | | --- | --- | --- | | Parameter | Default | Description | | `propertyName` | `` | `string` | | `value` | `` | `any` | | `oldValue` | `` | `any` | Returns _[PropertyChangeData](https://docs.nativescript.org/api/interface/PropertyChangeData)_ ### \_emit [​](https://docs.nativescript.org/api/class/Observable\#emit) ``` _emit(eventNames: string): void ``` defined in [@nativescript/core/data/observable/index.d.ts:155:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L155) | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventNames` | `` | `string` | Returns _void_ ### addEventListener [​](https://docs.nativescript.org/api/class/Observable\#addeventlistener) ``` addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:117:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L117) Adds a listener for the specified event name. | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventNames` | `` | `string`
Comma delimited names of the events to attach the listener to. | | `callback` | `` | `(data: EventData) => void`
A function to be called when some of the specified event(s) is raised. | | `thisArg` | `` | `any`
An optional parameter which when set will be used as "this" in callback method call. | Returns _void_ ### get [​](https://docs.nativescript.org/api/class/Observable\#get) ``` get(name: string): any ``` defined in [@nativescript/core/data/observable/index.d.ts:84:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L84) Gets the value of the specified property. | | | | | --- | --- | --- | | Parameter | Default | Description | | `name` | `` | `string` | Returns _any_ ### hasListeners [​](https://docs.nativescript.org/api/class/Observable\#haslisteners) ``` hasListeners(eventName: string): boolean ``` defined in [@nativescript/core/data/observable/index.d.ts:150:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L150) Checks whether a listener is registered for the specified event name. | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventName` | `` | `string`
The name of the event to check for. | Returns _boolean_ ### notify [​](https://docs.nativescript.org/api/class/Observable\#notify) ``` notify<T>(data: T): void ``` defined in [@nativescript/core/data/observable/index.d.ts:140:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L140) Notify this Observable instance with some data. This causes all event handlers on the Observable instance to be called, as well as any 'global' event handlers set on the instance's class. | | | | | --- | --- | --- | | Parameter | Default | Description | | `data` | `` | `T`
an object that satisfies the EventData interface, though with
an optional 'object' property. If left undefined, the 'object' property
will implicitly be set as this Observable instance. | Returns _void_ ### notifyPropertyChange [​](https://docs.nativescript.org/api/class/Observable\#notifypropertychange) ``` notifyPropertyChange(name: string, value: any, oldValue?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:145:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L145) Notifies all the registered listeners for the property change event. | | | | | --- | --- | --- | | Parameter | Default | Description | | `name` | `` | `string` | | `value` | `` | `any` | | `oldValue` | `` | `any` | Returns _void_ ### off [​](https://docs.nativescript.org/api/class/Observable\#off) ``` off(eventNames: string, callback?: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:110:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L110) Shortcut alias to the removeEventListener method. | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventNames` | `` | `string` | | `callback` | `` | `(data: EventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ### on [​](https://docs.nativescript.org/api/class/Observable\#on) ``` on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:99:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L99) A basic method signature to hook an event listener (shortcut alias to the addEventListener method). | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventNames` | `` | `string`
String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `` `,` `` (e.g. "propertyChange", "change"). | | `callback` | `` | `(data: EventData) => void`
Callback function which will be executed when event is raised. | | `thisArg` | `` | `any`
An optional parameter which will be used as `` `this` `` context for callback execution. | Returns _void_ ### once [​](https://docs.nativescript.org/api/class/Observable\#once) ``` once(event: string, callback: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:106:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L106) Adds one-time listener function for the event named `` `event` ``. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `string`
Name of the event to attach to. | | `callback` | `` | `(data: EventData) => void`
A function to be called when the specified event is raised. | | `thisArg` | `` | `any`
An optional parameter which when set will be used as "this" in callback method call. | Returns _void_ ### removeEventListener [​](https://docs.nativescript.org/api/class/Observable\#removeeventlistener) ``` removeEventListener(eventNames: string, callback?: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:124:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L124) Removes listener(s) for the specified event name. | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventNames` | `` | `string`
Comma delimited names of the events the specified listener is associated with. | | `callback` | `` | `(data: EventData) => void`
An optional parameter pointing to a specific listener. If not defined, all listeners for the event names will be removed. | | `thisArg` | `` | `any`
An optional parameter which when set will be used to refine search of the correct callback which will be removed as event listener. | Returns _void_ ### set [​](https://docs.nativescript.org/api/class/Observable\#set) ``` set(name: string, value: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:88:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L88) Updates the specified property with the provided value. | | | | | --- | --- | --- | | Parameter | Default | Description | | `name` | `` | `string` | | `value` | `` | `any` | Returns _void_ ### setProperty [​](https://docs.nativescript.org/api/class/Observable\#setproperty) ``` setProperty(name: string, value: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:92:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L92) Updates the specified property with the provided value and raises a property change event and a specific change event based on the property name. | | | | | --- | --- | --- | | Parameter | Default | Description | | `name` | `` | `string` | | `value` | `` | `any` | Returns _void_ ### addEventListener [​](https://docs.nativescript.org/api/class/Observable\#addeventlistener-1) Static ``` addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:129:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L129) | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventName` | `` | `string` | | `callback` | `` | `(data: EventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ### off [​](https://docs.nativescript.org/api/class/Observable\#off-1) Static ``` off(eventName: string, callback?: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:127:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L127) | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventName` | `` | `string` | | `callback` | `` | `(data: EventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ### on [​](https://docs.nativescript.org/api/class/Observable\#on-1) Static ``` on(eventName: string, callback: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:125:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L125) | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventName` | `` | `string` | | `callback` | `` | `(data: EventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ### once [​](https://docs.nativescript.org/api/class/Observable\#once-1) Static ``` once(eventName: string, callback: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:126:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L126) | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventName` | `` | `string` | | `callback` | `` | `(data: EventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ### removeEventListener [​](https://docs.nativescript.org/api/class/Observable\#removeeventlistener-1) Static ``` removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/data/observable/index.d.ts:128:4](https://unpkg.com/browse/@nativescript/core//data/observable/index.d.ts#L128) | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventName` | `` | `string` | | `callback` | `` | `(data: EventData) => void` | | `thisArg` | `` | `any` | Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/Observable#summary) 3. [Constructors](https://docs.nativescript.org/api/class/Observable#constructors) 1. [constructor](https://docs.nativescript.org/api/class/Observable#constructor) 4. [Properties](https://docs.nativescript.org/api/class/Observable#properties) 1. [propertyChangeEvent](https://docs.nativescript.org/api/class/Observable#propertychangeevent) 5. [Methods](https://docs.nativescript.org/api/class/Observable#methods) 01. [\_createPropertyChangeData](https://docs.nativescript.org/api/class/Observable#createpropertychangedata) 02. [\_emit](https://docs.nativescript.org/api/class/Observable#emit) 03. [addEventListener](https://docs.nativescript.org/api/class/Observable#addeventlistener) 04. [get](https://docs.nativescript.org/api/class/Observable#get) 05. [hasListeners](https://docs.nativescript.org/api/class/Observable#haslisteners) 06. [notify](https://docs.nativescript.org/api/class/Observable#notify) 07. [notifyPropertyChange](https://docs.nativescript.org/api/class/Observable#notifypropertychange) 08. [off](https://docs.nativescript.org/api/class/Observable#off) 09. [on](https://docs.nativescript.org/api/class/Observable#on) 10. [once](https://docs.nativescript.org/api/class/Observable#once) 11. [removeEventListener](https://docs.nativescript.org/api/class/Observable#removeeventlistener) 12. [set](https://docs.nativescript.org/api/class/Observable#set) 13. [setProperty](https://docs.nativescript.org/api/class/Observable#setproperty) 14. [addEventListener](https://docs.nativescript.org/api/class/Observable#addeventlistener-1) 15. [off](https://docs.nativescript.org/api/class/Observable#off-1) 16. [on](https://docs.nativescript.org/api/class/Observable#on-1) 17. [once](https://docs.nativescript.org/api/class/Observable#once-1) 18. [removeEventListener](https://docs.nativescript.org/api/class/Observable#removeeventlistener-1) ## Parser Event Types ParserEventType Specifies the type of parser event. ## Summary [​](https://docs.nativescript.org/api/class/ParserEventType\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/ParserEventType#constructor) #### Properties [CDATA](https://docs.nativescript.org/api/class/ParserEventType#cdata)[Comment](https://docs.nativescript.org/api/class/ParserEventType#comment)[EndElement](https://docs.nativescript.org/api/class/ParserEventType#endelement)[StartElement](https://docs.nativescript.org/api/class/ParserEventType#startelement)[Text](https://docs.nativescript.org/api/class/ParserEventType#text) ## Constructors [​](https://docs.nativescript.org/api/class/ParserEventType\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/ParserEventType\#constructor) ``` new ParserEventType(): ParserEventType ``` Returns _[ParserEventType](https://docs.nativescript.org/api/class/ParserEventType)_ ## Properties [​](https://docs.nativescript.org/api/class/ParserEventType\#properties) ### CDATA [​](https://docs.nativescript.org/api/class/ParserEventType\#cdata) Static ``` CDATA: string ``` defined in [@nativescript/core/xml/index.d.ts:27:8](https://unpkg.com/browse/@nativescript/core//xml/index.d.ts#L27) Specifies the CDATA event type. ### Comment [​](https://docs.nativescript.org/api/class/ParserEventType\#comment) Static ``` Comment: string ``` defined in [@nativescript/core/xml/index.d.ts:32:8](https://unpkg.com/browse/@nativescript/core//xml/index.d.ts#L32) Specifies the Comment event type. ### EndElement [​](https://docs.nativescript.org/api/class/ParserEventType\#endelement) Static ``` EndElement: string ``` defined in [@nativescript/core/xml/index.d.ts:17:8](https://unpkg.com/browse/@nativescript/core//xml/index.d.ts#L17) Specifies the EndElement event type. ### StartElement [​](https://docs.nativescript.org/api/class/ParserEventType\#startelement) Static ``` StartElement: string ``` defined in [@nativescript/core/xml/index.d.ts:12:8](https://unpkg.com/browse/@nativescript/core//xml/index.d.ts#L12) Specifies the StartElement event type. ### Text [​](https://docs.nativescript.org/api/class/ParserEventType\#text) Static ``` Text: string ``` defined in [@nativescript/core/xml/index.d.ts:22:8](https://unpkg.com/browse/@nativescript/core//xml/index.d.ts#L22) Specifies the Text event type. 2. [Summary](https://docs.nativescript.org/api/class/ParserEventType#summary) 3. [Constructors](https://docs.nativescript.org/api/class/ParserEventType#constructors) 1. [constructor](https://docs.nativescript.org/api/class/ParserEventType#constructor) 4. [Properties](https://docs.nativescript.org/api/class/ParserEventType#properties) 1. [CDATA](https://docs.nativescript.org/api/class/ParserEventType#cdata) 2. [Comment](https://docs.nativescript.org/api/class/ParserEventType#comment) 3. [EndElement](https://docs.nativescript.org/api/class/ParserEventType#endelement) 4. [StartElement](https://docs.nativescript.org/api/class/ParserEventType#startelement) 5. [Text](https://docs.nativescript.org/api/class/ParserEventType#text) ## ClassInfo Overview ClassInfo A Class holding information about a class ## Summary [​](https://docs.nativescript.org/api/class/Utils-ClassInfo\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/Utils-ClassInfo#constructor) #### Properties [baseClassInfo](https://docs.nativescript.org/api/class/Utils-ClassInfo#baseclassinfo)[name](https://docs.nativescript.org/api/class/Utils-ClassInfo#name) ## Constructors [​](https://docs.nativescript.org/api/class/Utils-ClassInfo\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/Utils-ClassInfo\#constructor) ``` new ClassInfo(): ClassInfo ``` Returns _[ClassInfo](https://docs.nativescript.org/api/class/Utils-ClassInfo)_ ## Properties [​](https://docs.nativescript.org/api/class/Utils-ClassInfo\#properties) ### baseClassInfo [​](https://docs.nativescript.org/api/class/Utils-ClassInfo\#baseclassinfo) ``` baseClassInfo: ClassInfo ``` defined in [@nativescript/core/utils/types.d.ts:109:1](https://unpkg.com/browse/@nativescript/core//utils/types.d.ts#L109) Gets the ClassInfo for the base class of the current info. ### name [​](https://docs.nativescript.org/api/class/Utils-ClassInfo\#name) ``` name: string ``` defined in [@nativescript/core/utils/types.d.ts:104:1](https://unpkg.com/browse/@nativescript/core//utils/types.d.ts#L104) Gets the name of the class. Next [AccessibilityEvents→](https://docs.nativescript.org/api/namespace/AccessibilityEvents) 2. [Summary](https://docs.nativescript.org/api/class/Utils-ClassInfo#summary) 3. [Constructors](https://docs.nativescript.org/api/class/Utils-ClassInfo#constructors) 1. [constructor](https://docs.nativescript.org/api/class/Utils-ClassInfo#constructor) 4. [Properties](https://docs.nativescript.org/api/class/Utils-ClassInfo#properties) 1. [baseClassInfo](https://docs.nativescript.org/api/class/Utils-ClassInfo#baseclassinfo) 2. [name](https://docs.nativescript.org/api/class/Utils-ClassInfo#name) ## Navigation Context Interface NavigationContext ``` interface NavigationContext { entry: BackstackEntry; isBackNavigation: boolean; navigationType: NavigationType; } ``` Represents a context passed to navigation methods. ## Summary [​](https://docs.nativescript.org/api/interface/NavigationContext\#summary) #### Properties [entry](https://docs.nativescript.org/api/interface/NavigationContext#entry)[isBackNavigation](https://docs.nativescript.org/api/interface/NavigationContext#isbacknavigation)[navigationType](https://docs.nativescript.org/api/interface/NavigationContext#navigationtype) ## Properties [​](https://docs.nativescript.org/api/interface/NavigationContext\#properties) ### entry [​](https://docs.nativescript.org/api/interface/NavigationContext\#entry) ``` entry: BackstackEntry ``` defined in [@nativescript/core/ui/frame/index.d.ts:337:1](https://unpkg.com/browse/@nativescript/core//ui/frame/index.d.ts#L337) ### isBackNavigation [​](https://docs.nativescript.org/api/interface/NavigationContext\#isbacknavigation) ``` isBackNavigation: boolean ``` defined in [@nativescript/core/ui/frame/index.d.ts:338:1](https://unpkg.com/browse/@nativescript/core//ui/frame/index.d.ts#L338) ### navigationType [​](https://docs.nativescript.org/api/interface/NavigationContext\#navigationtype) ``` navigationType: NavigationType ``` defined in [@nativescript/core/ui/frame/index.d.ts:339:1](https://unpkg.com/browse/@nativescript/core//ui/frame/index.d.ts#L339) 2. [Summary](https://docs.nativescript.org/api/interface/NavigationContext#summary) 3. [Properties](https://docs.nativescript.org/api/interface/NavigationContext#properties) 1. [entry](https://docs.nativescript.org/api/interface/NavigationContext#entry) 2. [isBackNavigation](https://docs.nativescript.org/api/interface/NavigationContext#isbacknavigation) 3. [navigationType](https://docs.nativescript.org/api/interface/NavigationContext#navigationtype) ## Downloaded Data Interface [EventData](https://docs.nativescript.org/api/interface/EventData) DownloadedData ``` interface DownloadedData extends EventData { image: ImageSource; key: string; } ``` Provides data for downloaded event. ## Summary [​](https://docs.nativescript.org/api/interface/DownloadedData\#summary) #### Properties [image](https://docs.nativescript.org/api/interface/DownloadedData#image)[key](https://docs.nativescript.org/api/interface/DownloadedData#key) 2 properties inherited from [EventData](https://docs.nativescript.org/api/interface/EventData) Click to expand [eventName](https://docs.nativescript.org/api/interface/EventData#eventname)[object](https://docs.nativescript.org/api/interface/EventData#object) ## Properties [​](https://docs.nativescript.org/api/interface/DownloadedData\#properties) ### image [​](https://docs.nativescript.org/api/interface/DownloadedData\#image) ``` image: ImageSource ``` defined in [@nativescript/core/ui/image-cache/index.d.ts:128:1](https://unpkg.com/browse/@nativescript/core//ui/image-cache/index.d.ts#L128) Gets the cached image. ### key [​](https://docs.nativescript.org/api/interface/DownloadedData\#key) ``` key: string ``` defined in [@nativescript/core/ui/image-cache/index.d.ts:124:1](https://unpkg.com/browse/@nativescript/core//ui/image-cache/index.d.ts#L124) A string indentifier of the cached image. 2. [Summary](https://docs.nativescript.org/api/interface/DownloadedData#summary) 3. [Properties](https://docs.nativescript.org/api/interface/DownloadedData#properties) 1. [image](https://docs.nativescript.org/api/interface/DownloadedData#image) 2. [key](https://docs.nativescript.org/api/interface/DownloadedData#key) ## Navigation Button [ActionItem](https://docs.nativescript.org/api/class/ActionItem) NavigationButton Represents the navigation (a.k.a. "back") button. ## Summary [​](https://docs.nativescript.org/api/class/NavigationButton\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/NavigationButton#constructor) ## Constructors [​](https://docs.nativescript.org/api/class/NavigationButton\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/NavigationButton\#constructor) ``` new NavigationButton(): NavigationButton ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[NavigationButton](https://docs.nativescript.org/api/class/NavigationButton)_ 2. [Summary](https://docs.nativescript.org/api/class/NavigationButton#summary) 3. [Constructors](https://docs.nativescript.org/api/class/NavigationButton#constructors) 1. [constructor](https://docs.nativescript.org/api/class/NavigationButton#constructor) ## ContainerView Class Overview [View](https://docs.nativescript.org/api/class/View) ContainerView [CustomLayoutView](https://docs.nativescript.org/api/class/CustomLayoutView) Base class for all UI components that are containers. ## Summary [​](https://docs.nativescript.org/api/class/ContainerView\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/ContainerView#constructor) #### Properties [iosOverflowSafeArea](https://docs.nativescript.org/api/class/ContainerView#iosoverflowsafearea) 153 properties inherited from View Click to expand \_androidContentDescriptionUpdated\_automaticallyAdjustsScrollViewInsets\_closeModalCallback\_context\_cssState\_defaultPaddingBottom\_defaultPaddingLeft\_defaultPaddingRight\_defaultPaddingTop\_domId\_ignoreFlexMinWidthHeightReset\_isAddedToNativeVisualTree\_isLayoutValid\_isPaddingRelative\_isStyleScopeHost\_oldBottom\_oldLeft\_oldRight\_oldTop\_styleScope\_suspendNativeUpdatesCountaccessibilityBlurEventaccessibilityFocusChangedEventaccessibilityFocusEventaccessibilityHiddenaccessibilityHintaccessibilityIdentifieraccessibilityLabelaccessibilityLanguageaccessibilityLiveRegionaccessibilityMediaSessionaccessibilityPerformEscapeEventaccessibilityRoleaccessibilityStateaccessibilityValueaccessiblealignSelfandroidandroidDynamicElevationOffsetandroidElevationautomationTextbackgroundbackgroundColorbackgroundImagebindingContextborderBottomColorborderBottomLeftRadiusborderBottomRightRadiusborderBottomWidthborderColorborderLeftColorborderLeftWidthborderRadiusborderRightColorborderRightWidthborderTopColorborderTopLeftRadiusborderTopRightRadiusborderTopWidthborderWidthboxShadowclassNamecolcolorcolSpancolumncolumnSpancreatedEventcssClassescssPseudoClassescssTypedisposeNativeViewEventdockdomNodeeffectiveBorderBottomWidtheffectiveBorderLeftWidtheffectiveBorderRightWidtheffectiveBorderTopWidtheffectiveHeighteffectiveLefteffectiveMarginBottomeffectiveMarginLefteffectiveMarginRighteffectiveMarginTopeffectiveMinHeighteffectiveMinWidtheffectivePaddingBottomeffectivePaddingLefteffectivePaddingRighteffectivePaddingTopeffectiveTopeffectiveWidthflexGrowflexShrinkflexWrapBeforeheighthorizontalAlignmentidignoreTouchAnimationiosiosAccessibilityAdjustsFontSizeiosAccessibilityMaxFontScaleiosAccessibilityMinFontScaleiosIgnoreSafeAreaiosOverflowSafeAreaEnabledisCollapsedisEnabledisLayoutValidisUserInteractionEnabledlayoutChangedEventleftloadedEventmarginmarginBottommarginLeftmarginRightmarginTopminHeightminWidthmodalnativeViewProtectedopacityorderoriginXoriginYparentperspectivepropertyChangeEventrecycleNativeViewreusablerotaterotateXrotateYrowrowSpanscaleXscaleYsharedTransitionIgnoresharedTransitionTagshowingModallyEventshownModallyEventtestIDtoptouchAnimationtouchDelaytransitionIdtranslateXtranslateYunloadedEventverticalAlignmentviewControllervisibilitywidth ## Constructors [​](https://docs.nativescript.org/api/class/ContainerView\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/ContainerView\#constructor) ``` new ContainerView(): ContainerView ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[ContainerView](https://docs.nativescript.org/api/class/ContainerView)_ ## Properties [​](https://docs.nativescript.org/api/class/ContainerView\#properties) ### iosOverflowSafeArea [​](https://docs.nativescript.org/api/class/ContainerView\#iosoverflowsafearea) ``` iosOverflowSafeArea: boolean ``` defined in [@nativescript/core/ui/core/view/index.d.ts:910:8](https://unpkg.com/browse/@nativescript/core//ui/core/view/index.d.ts#L910) Instruct container view to expand beyond the safe area. This property is iOS specific. Default value: true 2. [Summary](https://docs.nativescript.org/api/class/ContainerView#summary) 3. [Constructors](https://docs.nativescript.org/api/class/ContainerView#constructors) 1. [constructor](https://docs.nativescript.org/api/class/ContainerView#constructor) 4. [Properties](https://docs.nativescript.org/api/class/ContainerView#properties) 1. [iosOverflowSafeArea](https://docs.nativescript.org/api/class/ContainerView#iosoverflowsafearea) ## UI Repeater Component [CustomLayoutView](https://docs.nativescript.org/api/class/CustomLayoutView) Repeater Represents a UI Repeater component. ## Summary [​](https://docs.nativescript.org/api/class/Repeater\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/Repeater#constructor) #### Properties [android](https://docs.nativescript.org/api/class/Repeater#android)[ios](https://docs.nativescript.org/api/class/Repeater#ios)[items](https://docs.nativescript.org/api/class/Repeater#items)[itemsLayout](https://docs.nativescript.org/api/class/Repeater#itemslayout)[itemTemplate](https://docs.nativescript.org/api/class/Repeater#itemtemplate)[itemTemplates](https://docs.nativescript.org/api/class/Repeater#itemtemplates)[knownFunctions](https://docs.nativescript.org/api/class/Repeater#knownfunctions) 152 properties inherited from CustomLayoutView Click to expand \_androidContentDescriptionUpdated\_automaticallyAdjustsScrollViewInsets\_closeModalCallback\_context\_cssState\_defaultPaddingBottom\_defaultPaddingLeft\_defaultPaddingRight\_defaultPaddingTop\_domId\_ignoreFlexMinWidthHeightReset\_isAddedToNativeVisualTree\_isLayoutValid\_isPaddingRelative\_isStyleScopeHost\_oldBottom\_oldLeft\_oldRight\_oldTop\_styleScope\_suspendNativeUpdatesCountaccessibilityBlurEventaccessibilityFocusChangedEventaccessibilityFocusEventaccessibilityHiddenaccessibilityHintaccessibilityIdentifieraccessibilityLabelaccessibilityLanguageaccessibilityLiveRegionaccessibilityMediaSessionaccessibilityPerformEscapeEventaccessibilityRoleaccessibilityStateaccessibilityValueaccessiblealignSelfandroidDynamicElevationOffsetandroidElevationautomationTextbackgroundbackgroundColorbackgroundImagebindingContextborderBottomColorborderBottomLeftRadiusborderBottomRightRadiusborderBottomWidthborderColorborderLeftColorborderLeftWidthborderRadiusborderRightColorborderRightWidthborderTopColorborderTopLeftRadiusborderTopRightRadiusborderTopWidthborderWidthboxShadowclassNamecolcolorcolSpancolumncolumnSpancreatedEventcssClassescssPseudoClassescssTypedisposeNativeViewEventdockdomNodeeffectiveBorderBottomWidtheffectiveBorderLeftWidtheffectiveBorderRightWidtheffectiveBorderTopWidtheffectiveHeighteffectiveLefteffectiveMarginBottomeffectiveMarginLefteffectiveMarginRighteffectiveMarginTopeffectiveMinHeighteffectiveMinWidtheffectivePaddingBottomeffectivePaddingLefteffectivePaddingRighteffectivePaddingTopeffectiveTopeffectiveWidthflexGrowflexShrinkflexWrapBeforeheighthorizontalAlignmentidignoreTouchAnimationiosAccessibilityAdjustsFontSizeiosAccessibilityMaxFontScaleiosAccessibilityMinFontScaleiosIgnoreSafeAreaiosOverflowSafeAreaiosOverflowSafeAreaEnabledisCollapsedisEnabledisLayoutValidisUserInteractionEnabledlayoutChangedEventleftloadedEventmarginmarginBottommarginLeftmarginRightmarginTopminHeightminWidthmodalnativeViewProtectedopacityorderoriginXoriginYparentperspectivepropertyChangeEventrecycleNativeViewreusablerotaterotateXrotateYrowrowSpanscaleXscaleYsharedTransitionIgnoresharedTransitionTagshowingModallyEventshownModallyEventtestIDtoptouchAnimationtouchDelaytransitionIdtranslateXtranslateYunloadedEventverticalAlignmentviewControllervisibilitywidth #### Accessors [\_childrenCount](https://docs.nativescript.org/api/class/Repeater#childrencount)[itemTemplateSelector](https://docs.nativescript.org/api/class/Repeater#itemtemplateselector) 11 accessors inherited from CustomLayoutView Click to expand backgroundPositionbackgroundRepeatbackgroundSizeclassisLoadednativeViewpageparentNodestyletextTransformtypeName #### Methods [\_getDefaultItemContent](https://docs.nativescript.org/api/class/Repeater#getdefaultitemcontent)[\_onItemsChanged](https://docs.nativescript.org/api/class/Repeater#onitemschanged)[\_requestRefresh](https://docs.nativescript.org/api/class/Repeater#requestrefresh)[eachChildView](https://docs.nativescript.org/api/class/Repeater#eachchildview)[onLayout](https://docs.nativescript.org/api/class/Repeater#onlayout)[onLoaded](https://docs.nativescript.org/api/class/Repeater#onloaded)[onMeasure](https://docs.nativescript.org/api/class/Repeater#onmeasure)[refresh](https://docs.nativescript.org/api/class/Repeater#refresh) 108 methods inherited from CustomLayoutView Click to expand \_addView\_addViewCore\_addViewToNativeVisualTree\_applyXmlAttribute\_batchUpdate\_childIndexToNativeChildIndex\_closeAllModalViewsInternal\_createPropertyChangeData\_dialogClosed\_eachLayoutView\_emit\_getNativeViewsCount\_getRootModalViews\_getValue\_handleLivesync\_hasAncestorView\_hideNativeModalView\_inheritStyleScope\_layoutParent\_observe\_onAttachedToWindow\_onDetachedFromWindow\_onRootViewReset\_onSizeChanged\_parentChanged\_raiseLayoutChangedEvent\_raiseShowingModallyEvent\_raiseShownModallyEvent\_removeView\_removeViewCore\_removeViewFromNativeVisualTree\_resumeNativeUpdates\_setupAsRootView\_setupUI\_setValue\_shouldDelayLayout\_showNativeModalView\_suspendNativeUpdates\_tearDownUI\_updateStyleScopeaccessibilityAnnouncementaccessibilityScreenChangedaddEventListeneraddEventListeneraddPseudoClassanimatebindcallLoadedcallUnloadedcloseModalcombineMeasuredStatescreateAnimationcreateNativeViewdeletePseudoClassdestroyNodedisposeNativeVieweachChildensureDomNodefocusgetgetActualSizegetGestureObserversgetLocationInWindowgetLocationOnScreengetLocationRelativeTogetMeasuredHeightgetMeasuredStategetMeasuredWidthgetSafeAreaInsetsgetViewByDomIdgetViewByIdhasGestureObservershasListenersinitNativeViewlayoutlayoutChildlayoutNativeViewloadViewmeasuremeasureChildnotifynotifyPropertyChangeoffoffonononBackPressedonceonceonResumeNativeUpdatesonUnloadedremoveEventListenerremoveEventListenerrequestLayoutresetNativeViewresolveSizeAndStatesendAccessibilityEventsetsetInlineStylesetMeasuredDimensionsetNativeViewsetOnTouchListenersetPropertysetTestIDshowModaltoStringunbindunloadView ## Constructors [​](https://docs.nativescript.org/api/class/Repeater\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/Repeater\#constructor) ``` new Repeater(): Repeater ``` defined in [@nativescript/core/ui/repeater/index.d.ts:19:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L19) Returns _[Repeater](https://docs.nativescript.org/api/class/Repeater)_ ## Properties [​](https://docs.nativescript.org/api/class/Repeater\#properties) ### android [​](https://docs.nativescript.org/api/class/Repeater\#android) ``` android: any ``` defined in [@nativescript/core/ui/repeater/index.d.ts:18:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L18) ### ios [​](https://docs.nativescript.org/api/class/Repeater\#ios) ``` ios: any ``` defined in [@nativescript/core/ui/repeater/index.d.ts:17:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L17) ### itemTemplate [​](https://docs.nativescript.org/api/class/Repeater\#itemtemplate) ``` itemTemplate: string | Template ``` defined in [@nativescript/core/ui/repeater/index.d.ts:29:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L29) Gets or set the item template of the Repeater. ### itemTemplates [​](https://docs.nativescript.org/api/class/Repeater\#itemtemplates) ``` itemTemplates: string | KeyedTemplate[] ``` defined in [@nativescript/core/ui/repeater/index.d.ts:33:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L33) Gets or set the item templates of the Repeater. ### items [​](https://docs.nativescript.org/api/class/Repeater\#items) ``` items: any[] | ItemsSource ``` defined in [@nativescript/core/ui/repeater/index.d.ts:25:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L25) Gets or set the items collection of the Repeater. The items property can be set to an array or an object defining length and getItem(index) method. ### itemsLayout [​](https://docs.nativescript.org/api/class/Repeater\#itemslayout) ``` itemsLayout: LayoutBase ``` defined in [@nativescript/core/ui/repeater/index.d.ts:37:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L37) Gets or set the items layout of the Repeater. Default value is StackLayout with orientation="vertical". ### knownFunctions [​](https://docs.nativescript.org/api/class/Repeater\#knownfunctions) Static ``` knownFunctions: string[] ``` defined in [@nativescript/core/ui/repeater/index.d.ts:13:11](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L13) ## Accessors [​](https://docs.nativescript.org/api/class/Repeater\#accessors) ### \_childrenCount [​](https://docs.nativescript.org/api/class/Repeater\#childrencount) ``` get _childrenCount(): number ``` defined in [@nativescript/core/ui/repeater/index.d.ts:48:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L48) Returns _number_ ### itemTemplateSelector [​](https://docs.nativescript.org/api/class/Repeater\#itemtemplateselector) ``` get itemTemplateSelector(): string | (item: any, index: number, items: any) => string ``` defined in [@nativescript/core/ui/repeater/index.d.ts:38:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L38) Returns _string \| (item: any, index: number, items: any) => string_ ## Methods [​](https://docs.nativescript.org/api/class/Repeater\#methods) ### \_getDefaultItemContent [​](https://docs.nativescript.org/api/class/Repeater\#getdefaultitemcontent) ``` _getDefaultItemContent(index: number): View ``` defined in [@nativescript/core/ui/repeater/index.d.ts:46:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L46) | | | | | --- | --- | --- | | Parameter | Default | Description | | `index` | `` | `number` | Returns _[View](https://docs.nativescript.org/api/class/View)_ ### \_onItemsChanged [​](https://docs.nativescript.org/api/class/Repeater\#onitemschanged) ``` _onItemsChanged(data: ChangedData): void ``` defined in [@nativescript/core/ui/repeater/index.d.ts:45:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L45) | | | | | --- | --- | --- | | Parameter | Default | Description | | `data` | `` | `ChangedData` | Returns _void_ ### \_requestRefresh [​](https://docs.nativescript.org/api/class/Repeater\#requestrefresh) ``` _requestRefresh(): void ``` defined in [@nativescript/core/ui/repeater/index.d.ts:40:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L40) Returns _void_ ### eachChildView [​](https://docs.nativescript.org/api/class/Repeater\#eachchildview) ``` eachChildView(callback: (child: View) => boolean): void ``` defined in [@nativescript/core/ui/repeater/index.d.ts:49:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L49) | | | | | --- | --- | --- | | Parameter | Default | Description | | `callback` | `` | `(child: View) => boolean` | Returns _void_ ### onLayout [​](https://docs.nativescript.org/api/class/Repeater\#onlayout) ``` onLayout(left: number, top: number, right: number, bottom: number): void ``` defined in [@nativescript/core/ui/repeater/index.d.ts:50:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L50) | | | | | --- | --- | --- | | Parameter | Default | Description | | `left` | `` | `number` | | `top` | `` | `number` | | `right` | `` | `number` | | `bottom` | `` | `number` | Returns _void_ ### onLoaded [​](https://docs.nativescript.org/api/class/Repeater\#onloaded) ``` onLoaded(): void ``` defined in [@nativescript/core/ui/repeater/index.d.ts:20:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L20) Returns _void_ ### onMeasure [​](https://docs.nativescript.org/api/class/Repeater\#onmeasure) ``` onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void ``` defined in [@nativescript/core/ui/repeater/index.d.ts:51:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L51) | | | | | --- | --- | --- | | Parameter | Default | Description | | `widthMeasureSpec` | `` | `number` | | `heightMeasureSpec` | `` | `number` | Returns _void_ ### refresh [​](https://docs.nativescript.org/api/class/Repeater\#refresh) ``` refresh(): void ``` defined in [@nativescript/core/ui/repeater/index.d.ts:44:4](https://unpkg.com/browse/@nativescript/core//ui/repeater/index.d.ts#L44) Forces the Repeater to reload all its items. Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/Repeater#summary) 3. [Constructors](https://docs.nativescript.org/api/class/Repeater#constructors) 1. [constructor](https://docs.nativescript.org/api/class/Repeater#constructor) 4. [Properties](https://docs.nativescript.org/api/class/Repeater#properties) 1. [android](https://docs.nativescript.org/api/class/Repeater#android) 2. [ios](https://docs.nativescript.org/api/class/Repeater#ios) 3. [itemTemplate](https://docs.nativescript.org/api/class/Repeater#itemtemplate) 4. [itemTemplates](https://docs.nativescript.org/api/class/Repeater#itemtemplates) 5. [items](https://docs.nativescript.org/api/class/Repeater#items) 6. [itemsLayout](https://docs.nativescript.org/api/class/Repeater#itemslayout) 7. [knownFunctions](https://docs.nativescript.org/api/class/Repeater#knownfunctions) 5. [Accessors](https://docs.nativescript.org/api/class/Repeater#accessors) 1. [\_childrenCount](https://docs.nativescript.org/api/class/Repeater#childrencount) 2. [itemTemplateSelector](https://docs.nativescript.org/api/class/Repeater#itemtemplateselector) 6. [Methods](https://docs.nativescript.org/api/class/Repeater#methods) 1. [\_getDefaultItemContent](https://docs.nativescript.org/api/class/Repeater#getdefaultitemcontent) 2. [\_onItemsChanged](https://docs.nativescript.org/api/class/Repeater#onitemschanged) 3. [\_requestRefresh](https://docs.nativescript.org/api/class/Repeater#requestrefresh) 4. [eachChildView](https://docs.nativescript.org/api/class/Repeater#eachchildview) 5. [onLayout](https://docs.nativescript.org/api/class/Repeater#onlayout) 6. [onLoaded](https://docs.nativescript.org/api/class/Repeater#onloaded) 7. [onMeasure](https://docs.nativescript.org/api/class/Repeater#onmeasure) 8. [refresh](https://docs.nativescript.org/api/class/Repeater#refresh) ## SegmentedBar UI Component [View](https://docs.nativescript.org/api/class/View) SegmentedBar Represents a UI SegmentedBar component. ## Summary [​](https://docs.nativescript.org/api/class/SegmentedBar\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/SegmentedBar#constructor) #### Properties [items](https://docs.nativescript.org/api/class/SegmentedBar#items)[selectedBackgroundColor](https://docs.nativescript.org/api/class/SegmentedBar#selectedbackgroundcolor)[selectedIndex](https://docs.nativescript.org/api/class/SegmentedBar#selectedindex)[selectedIndexChangedEvent](https://docs.nativescript.org/api/class/SegmentedBar#selectedindexchangedevent) 154 properties inherited from View Click to expand \_androidContentDescriptionUpdated\_automaticallyAdjustsScrollViewInsets\_closeModalCallback\_context\_cssState\_defaultPaddingBottom\_defaultPaddingLeft\_defaultPaddingRight\_defaultPaddingTop\_domId\_ignoreFlexMinWidthHeightReset\_isAddedToNativeVisualTree\_isLayoutValid\_isPaddingRelative\_isStyleScopeHost\_oldBottom\_oldLeft\_oldRight\_oldTop\_styleScope\_suspendNativeUpdatesCountaccessibilityBlurEventaccessibilityFocusChangedEventaccessibilityFocusEventaccessibilityHiddenaccessibilityHintaccessibilityIdentifieraccessibilityLabelaccessibilityLanguageaccessibilityLiveRegionaccessibilityMediaSessionaccessibilityPerformEscapeEventaccessibilityRoleaccessibilityStateaccessibilityValueaccessiblealignSelfandroidandroidDynamicElevationOffsetandroidElevationautomationTextbackgroundbackgroundColorbackgroundImagebindingContextborderBottomColorborderBottomLeftRadiusborderBottomRightRadiusborderBottomWidthborderColorborderLeftColorborderLeftWidthborderRadiusborderRightColorborderRightWidthborderTopColorborderTopLeftRadiusborderTopRightRadiusborderTopWidthborderWidthboxShadowclassNamecolcolorcolSpancolumncolumnSpancreatedEventcssClassescssPseudoClassescssTypedisposeNativeViewEventdockdomNodeeffectiveBorderBottomWidtheffectiveBorderLeftWidtheffectiveBorderRightWidtheffectiveBorderTopWidtheffectiveHeighteffectiveLefteffectiveMarginBottomeffectiveMarginLefteffectiveMarginRighteffectiveMarginTopeffectiveMinHeighteffectiveMinWidtheffectivePaddingBottomeffectivePaddingLefteffectivePaddingRighteffectivePaddingTopeffectiveTopeffectiveWidthflexGrowflexShrinkflexWrapBeforeheighthorizontalAlignmentidignoreTouchAnimationiosiosAccessibilityAdjustsFontSizeiosAccessibilityMaxFontScaleiosAccessibilityMinFontScaleiosIgnoreSafeAreaiosOverflowSafeAreaiosOverflowSafeAreaEnabledisCollapsedisEnabledisLayoutValidisUserInteractionEnabledlayoutChangedEventleftloadedEventmarginmarginBottommarginLeftmarginRightmarginTopminHeightminWidthmodalnativeViewProtectedopacityorderoriginXoriginYparentperspectivepropertyChangeEventrecycleNativeViewreusablerotaterotateXrotateYrowrowSpanscaleXscaleYsharedTransitionIgnoresharedTransitionTagshowingModallyEventshownModallyEventtestIDtoptouchAnimationtouchDelaytransitionIdtranslateXtranslateYunloadedEventverticalAlignmentviewControllervisibilitywidth #### Methods [\_addArrayFromBuilder](https://docs.nativescript.org/api/class/SegmentedBar#addarrayfrombuilder)[\_addChildFromBuilder](https://docs.nativescript.org/api/class/SegmentedBar#addchildfrombuilder)[on](https://docs.nativescript.org/api/class/SegmentedBar#on) 111 methods inherited from View Click to expand \_addView\_addViewCore\_addViewToNativeVisualTree\_applyXmlAttribute\_batchUpdate\_childIndexToNativeChildIndex\_closeAllModalViewsInternal\_createPropertyChangeData\_dialogClosed\_eachLayoutView\_emit\_getNativeViewsCount\_getRootModalViews\_getValue\_handleLivesync\_hasAncestorView\_hideNativeModalView\_inheritStyleScope\_layoutParent\_observe\_onAttachedToWindow\_onDetachedFromWindow\_onRootViewReset\_onSizeChanged\_parentChanged\_raiseLayoutChangedEvent\_raiseShowingModallyEvent\_raiseShownModallyEvent\_removeView\_removeViewCore\_removeViewFromNativeVisualTree\_resumeNativeUpdates\_setupAsRootView\_setupUI\_setValue\_shouldDelayLayout\_showNativeModalView\_suspendNativeUpdates\_tearDownUI\_updateStyleScopeaccessibilityAnnouncementaccessibilityScreenChangedaddEventListeneraddEventListeneraddPseudoClassanimatebindcallLoadedcallUnloadedcloseModalcombineMeasuredStatescreateAnimationcreateNativeViewdeletePseudoClassdestroyNodedisposeNativeVieweachChildeachChildViewensureDomNodefocusgetgetActualSizegetGestureObserversgetLocationInWindowgetLocationOnScreengetLocationRelativeTogetMeasuredHeightgetMeasuredStategetMeasuredWidthgetSafeAreaInsetsgetViewByDomIdgetViewByIdhasGestureObservershasListenersinitNativeViewlayoutlayoutChildlayoutNativeViewloadViewmeasuremeasureChildnotifynotifyPropertyChangeoffoffononBackPressedonceonceonLayoutonLoadedonMeasureonResumeNativeUpdatesonUnloadedremoveEventListenerremoveEventListenerrequestLayoutresetNativeViewresolveSizeAndStatesendAccessibilityEventsetsetInlineStylesetMeasuredDimensionsetNativeViewsetOnTouchListenersetPropertysetTestIDshowModaltoStringunbindunloadView ## Constructors [​](https://docs.nativescript.org/api/class/SegmentedBar\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/SegmentedBar\#constructor) ``` new SegmentedBar(): SegmentedBar ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[SegmentedBar](https://docs.nativescript.org/api/class/SegmentedBar)_ ## Properties [​](https://docs.nativescript.org/api/class/SegmentedBar\#properties) ### items [​](https://docs.nativescript.org/api/class/SegmentedBar\#items) ``` items: SegmentedBarItem[] ``` defined in [@nativescript/core/ui/segmented-bar/index.d.ts:50:1](https://unpkg.com/browse/@nativescript/core//ui/segmented-bar/index.d.ts#L50) Gets or sets the items of the SegmentedBar. ### selectedBackgroundColor [​](https://docs.nativescript.org/api/class/SegmentedBar\#selectedbackgroundcolor) ``` selectedBackgroundColor: Color ``` defined in [@nativescript/core/ui/segmented-bar/index.d.ts:45:1](https://unpkg.com/browse/@nativescript/core//ui/segmented-bar/index.d.ts#L45) Gets or sets the selected background color of the SegmentedBar component. ### selectedIndex [​](https://docs.nativescript.org/api/class/SegmentedBar\#selectedindex) ``` selectedIndex: number ``` defined in [@nativescript/core/ui/segmented-bar/index.d.ts:40:1](https://unpkg.com/browse/@nativescript/core//ui/segmented-bar/index.d.ts#L40) Gets or sets the selected index of the SegmentedBar component. ### selectedIndexChangedEvent [​](https://docs.nativescript.org/api/class/SegmentedBar\#selectedindexchangedevent) Static ``` selectedIndexChangedEvent: string ``` defined in [@nativescript/core/ui/segmented-bar/index.d.ts:55:15](https://unpkg.com/browse/@nativescript/core//ui/segmented-bar/index.d.ts#L55) String value used when hooking to the selectedIndexChanged event. ## Methods [​](https://docs.nativescript.org/api/class/SegmentedBar\#methods) ### \_addArrayFromBuilder [​](https://docs.nativescript.org/api/class/SegmentedBar\#addarrayfrombuilder) ``` _addArrayFromBuilder(name: string, value: any[]): void ``` defined in [@nativescript/core/ui/segmented-bar/index.d.ts:76:1](https://unpkg.com/browse/@nativescript/core//ui/segmented-bar/index.d.ts#L76) | | | | | --- | --- | --- | | Parameter | Default | Description | | `name` | `` | `string` | | `value` | `` | `any[]` | Returns _void_ ### \_addChildFromBuilder [​](https://docs.nativescript.org/api/class/SegmentedBar\#addchildfrombuilder) ``` _addChildFromBuilder(name: string, value: any): void ``` defined in [@nativescript/core/ui/segmented-bar/index.d.ts:75:1](https://unpkg.com/browse/@nativescript/core//ui/segmented-bar/index.d.ts#L75) Called for every child element declared in xml. | | | | | --- | --- | --- | | Parameter | Default | Description | | `name` | `` | `string`
Name of the element. | | `value` | `` | `any`
Value of the element. | Returns _void_ ### on [​](https://docs.nativescript.org/api/class/SegmentedBar\#on) ``` on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/ui/segmented-bar/index.d.ts:63:1](https://unpkg.com/browse/@nativescript/core//ui/segmented-bar/index.d.ts#L63) A basic method signature to hook an event listener (shortcut alias to the addEventListener method). | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventNames` | `` | `string`
String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `` `,` `` (e.g. "propertyChange", "change"). | | `callback` | `` | `(data: EventData) => void`
Callback function which will be executed when event is raised. | | `thisArg` | `` | `any`
An optional parameter which will be used as `` `this` `` context for callback execution. | Returns _void_ ``` on( event: "selectedIndexChanged", callback: (args: SelectedIndexChangedEventData) => void, thisArg?: any ): void ``` defined in [@nativescript/core/ui/segmented-bar/index.d.ts:68:1](https://unpkg.com/browse/@nativescript/core//ui/segmented-bar/index.d.ts#L68) Raised when the selected index changes. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"selectedIndexChanged"` | | `callback` | `` | `(args: SelectedIndexChangedEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/SegmentedBar#summary) 3. [Constructors](https://docs.nativescript.org/api/class/SegmentedBar#constructors) 1. [constructor](https://docs.nativescript.org/api/class/SegmentedBar#constructor) 4. [Properties](https://docs.nativescript.org/api/class/SegmentedBar#properties) 1. [items](https://docs.nativescript.org/api/class/SegmentedBar#items) 2. [selectedBackgroundColor](https://docs.nativescript.org/api/class/SegmentedBar#selectedbackgroundcolor) 3. [selectedIndex](https://docs.nativescript.org/api/class/SegmentedBar#selectedindex) 4. [selectedIndexChangedEvent](https://docs.nativescript.org/api/class/SegmentedBar#selectedindexchangedevent) 5. [Methods](https://docs.nativescript.org/api/class/SegmentedBar#methods) 1. [\_addArrayFromBuilder](https://docs.nativescript.org/api/class/SegmentedBar#addarrayfrombuilder) 2. [\_addChildFromBuilder](https://docs.nativescript.org/api/class/SegmentedBar#addchildfrombuilder) 3. [on](https://docs.nativescript.org/api/class/SegmentedBar#on) ## TypeScript Configuration Guide Projects using TypeScript use the `tsconfig.json` to control the TypeScript compilation. Our templates ship with curated default values, however if you need to, you can fine-tune the [compiler options](https://www.typescriptlang.org/docs/handbook/compiler-options.html). For more information see the official [TypeScript documentation](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). json ``` { "compilerOptions": { "module": "ESNext", "target": "ES2020", "moduleResolution": "node", "experimentalDecorators": true, "emitDecoratorMetadata": true, "noEmitHelpers": true, "noEmitOnError": true, "skipLibCheck": true, "lib": ["ESNext", "dom"], "baseUrl": ".", "paths": { "~/*": ["src/*"], "@/*": ["src/*"] } }, "include": ["src/**/*", "activity.android.ts", "application.android.ts"], "files": ["./references.d.ts"], "exclude": ["node_modules", "platforms"] } ``` ## WebView Load Event Data [EventData](https://docs.nativescript.org/api/interface/EventData) LoadEventData ``` interface LoadEventData extends EventData { error: string; navigationType: NavigationType; url: string; } ``` Event data containing information for the loading events of a WebView. ## Summary [​](https://docs.nativescript.org/api/interface/LoadEventData\#summary) #### Properties [error](https://docs.nativescript.org/api/interface/LoadEventData#error)[navigationType](https://docs.nativescript.org/api/interface/LoadEventData#navigationtype)[url](https://docs.nativescript.org/api/interface/LoadEventData#url) 2 properties inherited from [EventData](https://docs.nativescript.org/api/interface/EventData) Click to expand [eventName](https://docs.nativescript.org/api/interface/EventData#eventname)[object](https://docs.nativescript.org/api/interface/EventData#object) ## Properties [​](https://docs.nativescript.org/api/interface/LoadEventData\#properties) ### error [​](https://docs.nativescript.org/api/interface/LoadEventData\#error) ``` error: string ``` defined in [@nativescript/core/ui/web-view/index.d.ts:125:1](https://unpkg.com/browse/@nativescript/core//ui/web-view/index.d.ts#L125) Gets the error (if any). ### navigationType [​](https://docs.nativescript.org/api/interface/LoadEventData\#navigationtype) ``` navigationType: NavigationType ``` defined in [@nativescript/core/ui/web-view/index.d.ts:120:1](https://unpkg.com/browse/@nativescript/core//ui/web-view/index.d.ts#L120) Gets the navigation type of the web-view. ### url [​](https://docs.nativescript.org/api/interface/LoadEventData\#url) ``` url: string ``` defined in [@nativescript/core/ui/web-view/index.d.ts:115:1](https://unpkg.com/browse/@nativescript/core//ui/web-view/index.d.ts#L115) Gets the url of the web-view. 2. [Summary](https://docs.nativescript.org/api/interface/LoadEventData#summary) 3. [Properties](https://docs.nativescript.org/api/interface/LoadEventData#properties) 1. [error](https://docs.nativescript.org/api/interface/LoadEventData#error) 2. [navigationType](https://docs.nativescript.org/api/interface/LoadEventData#navigationtype) 3. [url](https://docs.nativescript.org/api/interface/LoadEventData#url) ## ListView Component [View](https://docs.nativescript.org/api/class/View) ListView Represents a view that shows items in a vertically scrolling list. ## Summary [​](https://docs.nativescript.org/api/class/ListView\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/ListView#constructor) #### Properties [android](https://docs.nativescript.org/api/class/ListView#android)[ios](https://docs.nativescript.org/api/class/ListView#ios)[iosEstimatedRowHeight](https://docs.nativescript.org/api/class/ListView#iosestimatedrowheight)[itemIdGenerator](https://docs.nativescript.org/api/class/ListView#itemidgenerator)[itemLoadingEvent](https://docs.nativescript.org/api/class/ListView#itemloadingevent)[items](https://docs.nativescript.org/api/class/ListView#items)[itemTapEvent](https://docs.nativescript.org/api/class/ListView#itemtapevent)[itemTemplate](https://docs.nativescript.org/api/class/ListView#itemtemplate)[itemTemplates](https://docs.nativescript.org/api/class/ListView#itemtemplates)[itemTemplateSelector](https://docs.nativescript.org/api/class/ListView#itemtemplateselector)[loadMoreItemsEvent](https://docs.nativescript.org/api/class/ListView#loadmoreitemsevent)[rowHeight](https://docs.nativescript.org/api/class/ListView#rowheight)[separatorColor](https://docs.nativescript.org/api/class/ListView#separatorcolor) #### Methods [isItemAtIndexVisible](https://docs.nativescript.org/api/class/ListView#isitematindexvisible)[on](https://docs.nativescript.org/api/class/ListView#on)[refresh](https://docs.nativescript.org/api/class/ListView#refresh)[scrollToIndex](https://docs.nativescript.org/api/class/ListView#scrolltoindex)[scrollToIndexAnimated](https://docs.nativescript.org/api/class/ListView#scrolltoindexanimated) 111 methods inherited from View Click to expand \_addView\_addViewCore\_addViewToNativeVisualTree\_applyXmlAttribute\_batchUpdate\_childIndexToNativeChildIndex\_closeAllModalViewsInternal\_createPropertyChangeData\_dialogClosed\_eachLayoutView\_emit\_getNativeViewsCount\_getRootModalViews\_getValue\_handleLivesync\_hasAncestorView\_hideNativeModalView\_inheritStyleScope\_layoutParent\_observe\_onAttachedToWindow\_onDetachedFromWindow\_onRootViewReset\_onSizeChanged\_parentChanged\_raiseLayoutChangedEvent\_raiseShowingModallyEvent\_raiseShownModallyEvent\_removeView\_removeViewCore\_removeViewFromNativeVisualTree\_resumeNativeUpdates\_setupAsRootView\_setupUI\_setValue\_shouldDelayLayout\_showNativeModalView\_suspendNativeUpdates\_tearDownUI\_updateStyleScopeaccessibilityAnnouncementaccessibilityScreenChangedaddEventListeneraddEventListeneraddPseudoClassanimatebindcallLoadedcallUnloadedcloseModalcombineMeasuredStatescreateAnimationcreateNativeViewdeletePseudoClassdestroyNodedisposeNativeVieweachChildeachChildViewensureDomNodefocusgetgetActualSizegetGestureObserversgetLocationInWindowgetLocationOnScreengetLocationRelativeTogetMeasuredHeightgetMeasuredStategetMeasuredWidthgetSafeAreaInsetsgetViewByDomIdgetViewByIdhasGestureObservershasListenersinitNativeViewlayoutlayoutChildlayoutNativeViewloadViewmeasuremeasureChildnotifynotifyPropertyChangeoffoffononBackPressedonceonceonLayoutonLoadedonMeasureonResumeNativeUpdatesonUnloadedremoveEventListenerremoveEventListenerrequestLayoutresetNativeViewresolveSizeAndStatesendAccessibilityEventsetsetInlineStylesetMeasuredDimensionsetNativeViewsetOnTouchListenersetPropertysetTestIDshowModaltoStringunbindunloadView ## Constructors [​](https://docs.nativescript.org/api/class/ListView\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/ListView\#constructor) ``` new ListView(): ListView ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[ListView](https://docs.nativescript.org/api/class/ListView)_ ## Properties [​](https://docs.nativescript.org/api/class/ListView\#properties) ### android [​](https://docs.nativescript.org/api/class/ListView\#android) ``` android: any ``` defined in [@nativescript/core/ui/list-view/index.d.ts:29:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L29) Gets the native \[android widget\](http://developer.android.com/reference/android/widget/ListView.html) that represents the user interface for this component. Valid only when running on Android OS. ### ios [​](https://docs.nativescript.org/api/class/ListView\#ios) ``` ios: any ``` defined in [@nativescript/core/ui/list-view/index.d.ts:34:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L34) Gets the native \[iOS view\](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableView\_Class/) that represents the user interface for this component. Valid only when running on iOS. ### iosEstimatedRowHeight [​](https://docs.nativescript.org/api/class/ListView\#iosestimatedrowheight) ``` iosEstimatedRowHeight: LengthType ``` defined in [@nativescript/core/ui/list-view/index.d.ts:76:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L76) Gets or set the estimated height of rows in the ListView. The default value is 44px. ### itemIdGenerator [​](https://docs.nativescript.org/api/class/ListView\#itemidgenerator) ``` itemIdGenerator: (item: any, index: number, items: any) => number ``` defined in [@nativescript/core/ui/list-view/index.d.ts:60:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L60) ### itemTemplate [​](https://docs.nativescript.org/api/class/ListView\#itemtemplate) ``` itemTemplate: string | Template ``` defined in [@nativescript/core/ui/list-view/index.d.ts:45:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L45) Gets or set the item template of the ListView. ### itemTemplateSelector [​](https://docs.nativescript.org/api/class/ListView\#itemtemplateselector) ``` itemTemplateSelector: string | (item: any, index: number, items: any) => string ``` defined in [@nativescript/core/ui/list-view/index.d.ts:55:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L55) A function that returns the appropriate ket template based on the data item. ### itemTemplates [​](https://docs.nativescript.org/api/class/ListView\#itemtemplates) ``` itemTemplates: string | KeyedTemplate[] ``` defined in [@nativescript/core/ui/list-view/index.d.ts:50:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L50) Gets or set the list of item templates for the item template selector ### items [​](https://docs.nativescript.org/api/class/ListView\#items) ``` items: any[] | ItemsSource ``` defined in [@nativescript/core/ui/list-view/index.d.ts:40:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L40) Gets or set the items collection of the ListView. The items property can be set to an array or an object defining length and getItem(index) method. ### rowHeight [​](https://docs.nativescript.org/api/class/ListView\#rowheight) ``` rowHeight: LengthType ``` defined in [@nativescript/core/ui/list-view/index.d.ts:70:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L70) Gets or set row height of the ListView. ### separatorColor [​](https://docs.nativescript.org/api/class/ListView\#separatorcolor) ``` separatorColor: Color ``` defined in [@nativescript/core/ui/list-view/index.d.ts:65:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L65) Gets or set the items separator line color of the ListView. ### itemLoadingEvent [​](https://docs.nativescript.org/api/class/ListView\#itemloadingevent) Static ``` itemLoadingEvent: string ``` defined in [@nativescript/core/ui/list-view/index.d.ts:16:15](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L16) String value used when hooking to itemLoading event. ### itemTapEvent [​](https://docs.nativescript.org/api/class/ListView\#itemtapevent) Static ``` itemTapEvent: string ``` defined in [@nativescript/core/ui/list-view/index.d.ts:20:15](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L20) String value used when hooking to itemTap event. ### loadMoreItemsEvent [​](https://docs.nativescript.org/api/class/ListView\#loadmoreitemsevent) Static ``` loadMoreItemsEvent: string ``` defined in [@nativescript/core/ui/list-view/index.d.ts:24:15](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L24) String value used when hooking to loadMoreItems event. ## Methods [​](https://docs.nativescript.org/api/class/ListView\#methods) ### isItemAtIndexVisible [​](https://docs.nativescript.org/api/class/ListView\#isitematindexvisible) ``` isItemAtIndexVisible(index: number): boolean ``` defined in [@nativescript/core/ui/list-view/index.d.ts:103:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L103) Checks if Specified item with index is visible. | | | | | --- | --- | --- | | Parameter | Default | Description | | `index` | `` | `number`
Item index. | Returns _boolean_ ### on [​](https://docs.nativescript.org/api/class/ListView\#on) ``` on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/ui/list-view/index.d.ts:111:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L111) A basic method signature to hook an event listener (shortcut alias to the addEventListener method). | | | | | --- | --- | --- | | Parameter | Default | Description | | `eventNames` | `` | `string`
String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `` `,` `` (e.g. "propertyChange", "change"). | | `callback` | `` | `(data: EventData) => void`
Callback function which will be executed when event is raised. | | `thisArg` | `` | `any`
An optional parameter which will be used as `` `this` `` context for callback execution. | Returns _void_ ``` on(event: "itemLoading", callback: (args: ItemEventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/ui/list-view/index.d.ts:119:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L119) Raised when a View for the data at the specified index should be created. The result should be returned trough the view property of the event data. Note, that the view property of the event data can be pre-initialized with an old instance of a view, so that it can be reused. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"itemLoading"` | | `callback` | `` | `(args: ItemEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on(event: "itemTap", callback: (args: ItemEventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/ui/list-view/index.d.ts:124:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L124) Raised when an item inside the ListView is tapped. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"itemTap"` | | `callback` | `` | `(args: ItemEventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ``` on(event: "loadMoreItems", callback: (args: EventData) => void, thisArg?: any): void ``` defined in [@nativescript/core/ui/list-view/index.d.ts:129:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L129) Raised when the ListView is scrolled so that its last item is visible. | | | | | --- | --- | --- | | Parameter | Default | Description | | `event` | `` | `"loadMoreItems"` | | `callback` | `` | `(args: EventData) => void` | | `thisArg` | `` | `any` | Returns _void_ ### refresh [​](https://docs.nativescript.org/api/class/ListView\#refresh) ``` refresh(): any ``` defined in [@nativescript/core/ui/list-view/index.d.ts:81:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L81) Forces the ListView to reload all its items. Returns _any_ ### scrollToIndex [​](https://docs.nativescript.org/api/class/ListView\#scrolltoindex) ``` scrollToIndex(index: number): any ``` defined in [@nativescript/core/ui/list-view/index.d.ts:89:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L89) Scrolls the specified item with index into view. \[iOS\](https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITableView\_Class/#//apple\_ref/occ/instm/UITableView/scrollToRowAtIndexPath:atScrollPosition:animated:) \[Android\](http://developer.android.com/reference/android/widget/ListView.html#setSelection(int)) | | | | | --- | --- | --- | | Parameter | Default | Description | | `index` | `` | `number`
Item index. | Returns _any_ ### scrollToIndexAnimated [​](https://docs.nativescript.org/api/class/ListView\#scrolltoindexanimated) ``` scrollToIndexAnimated(index: number): any ``` defined in [@nativescript/core/ui/list-view/index.d.ts:97:1](https://unpkg.com/browse/@nativescript/core//ui/list-view/index.d.ts#L97) Scrolls the specified item with index into view with animation. \[iOS\](https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITableView\_Class/#//apple\_ref/occ/instm/UITableView/scrollToRowAtIndexPath:atScrollPosition:animated:) \[Android\](https://developer.android.com/reference/android/widget/ListView.html#smoothScrollToPosition(int)) | | | | | --- | --- | --- | | Parameter | Default | Description | | `index` | `` | `number`
Item index. | Returns _any_ 2. [Summary](https://docs.nativescript.org/api/class/ListView#summary) 3. [Constructors](https://docs.nativescript.org/api/class/ListView#constructors) 1. [constructor](https://docs.nativescript.org/api/class/ListView#constructor) 4. [Properties](https://docs.nativescript.org/api/class/ListView#properties) 01. [android](https://docs.nativescript.org/api/class/ListView#android) 02. [ios](https://docs.nativescript.org/api/class/ListView#ios) 03. [iosEstimatedRowHeight](https://docs.nativescript.org/api/class/ListView#iosestimatedrowheight) 04. [itemIdGenerator](https://docs.nativescript.org/api/class/ListView#itemidgenerator) 05. [itemTemplate](https://docs.nativescript.org/api/class/ListView#itemtemplate) 06. [itemTemplateSelector](https://docs.nativescript.org/api/class/ListView#itemtemplateselector) 07. [itemTemplates](https://docs.nativescript.org/api/class/ListView#itemtemplates) 08. [items](https://docs.nativescript.org/api/class/ListView#items) 09. [rowHeight](https://docs.nativescript.org/api/class/ListView#rowheight) 10. [separatorColor](https://docs.nativescript.org/api/class/ListView#separatorcolor) 11. [itemLoadingEvent](https://docs.nativescript.org/api/class/ListView#itemloadingevent) 12. [itemTapEvent](https://docs.nativescript.org/api/class/ListView#itemtapevent) 13. [loadMoreItemsEvent](https://docs.nativescript.org/api/class/ListView#loadmoreitemsevent) 5. [Methods](https://docs.nativescript.org/api/class/ListView#methods) 1. [isItemAtIndexVisible](https://docs.nativescript.org/api/class/ListView#isitematindexvisible) 2. [on](https://docs.nativescript.org/api/class/ListView#on) 3. [refresh](https://docs.nativescript.org/api/class/ListView#refresh) 4. [scrollToIndex](https://docs.nativescript.org/api/class/ListView#scrolltoindex) 5. [scrollToIndexAnimated](https://docs.nativescript.org/api/class/ListView#scrolltoindexanimated) ## SlideTransition Class [Transition](https://docs.nativescript.org/api/class/Transition) SlideTransition ## Summary [​](https://docs.nativescript.org/api/class/SlideTransition\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/SlideTransition#constructor) ## Constructors [​](https://docs.nativescript.org/api/class/SlideTransition\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/SlideTransition\#constructor) ``` new SlideTransition(direction: string, duration?: number, nativeCurve?: any): SlideTransition ``` defined in [@nativescript/core/ui/transition/slide-transition.d.ts:4:1](https://unpkg.com/browse/@nativescript/core//ui/transition/slide-transition.d.ts#L4) | | | | | --- | --- | --- | | Parameter | Default | Description | | `direction` | `` | `string` | | `duration` | `` | `number` | | `nativeCurve` | `` | `any` | Returns _[SlideTransition](https://docs.nativescript.org/api/class/SlideTransition)_ 2. [Summary](https://docs.nativescript.org/api/class/SlideTransition#summary) 3. [Constructors](https://docs.nativescript.org/api/class/SlideTransition#constructors) 1. [constructor](https://docs.nativescript.org/api/class/SlideTransition#constructor) ## NativeScriptError Interface Error NativeScriptError ``` interface NativeScriptError extends Error { nativeException: any; stack: string; stackTrace: string; } ``` An extended JavaScript Error which will have the nativeError property initialized in case the error is caused by executing platform-specific code. ## Summary [​](https://docs.nativescript.org/api/interface/NativeScriptError\#summary) #### Properties [nativeException](https://docs.nativescript.org/api/interface/NativeScriptError#nativeexception)[stack](https://docs.nativescript.org/api/interface/NativeScriptError#stack)[stackTrace](https://docs.nativescript.org/api/interface/NativeScriptError#stacktrace) 2 properties inherited from Error Click to expand messagename ## Properties [​](https://docs.nativescript.org/api/interface/NativeScriptError\#properties) ### nativeException [​](https://docs.nativescript.org/api/interface/NativeScriptError\#nativeexception) ``` nativeException?: any ``` defined in [@nativescript/core/application/application-interfaces.d.ts:11:4](https://unpkg.com/browse/@nativescript/core//application/application-interfaces.d.ts#L11) Represents the native error object. ### stack [​](https://docs.nativescript.org/api/interface/NativeScriptError\#stack) ``` stack?: string ``` defined in [@nativescript/core/application/application-interfaces.d.ts:19:4](https://unpkg.com/browse/@nativescript/core//application/application-interfaces.d.ts#L19) Javascript portion of stack trace. ### stackTrace [​](https://docs.nativescript.org/api/interface/NativeScriptError\#stacktrace) ``` stackTrace?: string ``` defined in [@nativescript/core/application/application-interfaces.d.ts:15:4](https://unpkg.com/browse/@nativescript/core//application/application-interfaces.d.ts#L15) The native stack trace. 2. [Summary](https://docs.nativescript.org/api/interface/NativeScriptError#summary) 3. [Properties](https://docs.nativescript.org/api/interface/NativeScriptError#properties) 1. [nativeException](https://docs.nativescript.org/api/interface/NativeScriptError#nativeexception) 2. [stack](https://docs.nativescript.org/api/interface/NativeScriptError#stack) 3. [stackTrace](https://docs.nativescript.org/api/interface/NativeScriptError#stacktrace) ## Editable Text Base [TextBase](https://docs.nativescript.org/api/class/TextBase) EditableTextBase [TextField](https://docs.nativescript.org/api/class/TextField) [TextView](https://docs.nativescript.org/api/class/TextView) Represents the base class for all editable text views. ## Summary [​](https://docs.nativescript.org/api/class/EditableTextBase\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/EditableTextBase#constructor) #### Properties [autocapitalizationType](https://docs.nativescript.org/api/class/EditableTextBase#autocapitalizationtype)[autocorrect](https://docs.nativescript.org/api/class/EditableTextBase#autocorrect)[autofillType](https://docs.nativescript.org/api/class/EditableTextBase#autofilltype)[blurEvent](https://docs.nativescript.org/api/class/EditableTextBase#blurevent)[editable](https://docs.nativescript.org/api/class/EditableTextBase#editable)[focusEvent](https://docs.nativescript.org/api/class/EditableTextBase#focusevent)[hint](https://docs.nativescript.org/api/class/EditableTextBase#hint)[keyboardType](https://docs.nativescript.org/api/class/EditableTextBase#keyboardtype)[maxLength](https://docs.nativescript.org/api/class/EditableTextBase#maxlength)[returnKeyType](https://docs.nativescript.org/api/class/EditableTextBase#returnkeytype)[textChangeEvent](https://docs.nativescript.org/api/class/EditableTextBase#textchangeevent)[updateTextTrigger](https://docs.nativescript.org/api/class/EditableTextBase#updatetexttrigger)[valueFormatter](https://docs.nativescript.org/api/class/EditableTextBase#valueformatter) 171 properties inherited from TextBase Click to expand \_androidContentDescriptionUpdated\_automaticallyAdjustsScrollViewInsets\_closeModalCallback\_context\_cssState\_defaultPaddingBottom\_defaultPaddingLeft\_defaultPaddingRight\_defaultPaddingTop\_domId\_ignoreFlexMinWidthHeightReset\_isAddedToNativeVisualTree\_isLayoutValid\_isPaddingRelative\_isStyleScopeHost\_oldBottom\_oldLeft\_oldRight\_oldTop\_styleScope\_suspendNativeUpdatesCountaccessibilityBlurEventaccessibilityFocusChangedEventaccessibilityFocusEventaccessibilityHiddenaccessibilityHintaccessibilityIdentifieraccessibilityLabelaccessibilityLanguageaccessibilityLiveRegionaccessibilityMediaSessionaccessibilityPerformEscapeEventaccessibilityRoleaccessibilityStateaccessibilityValueaccessiblealignSelfandroidandroidDynamicElevationOffsetandroidElevationautomationTextbackgroundbackgroundColorbackgroundImagebindingContextborderBottomColorborderBottomLeftRadiusborderBottomRightRadiusborderBottomWidthborderColorborderLeftColorborderLeftWidthborderRadiusborderRightColorborderRightWidthborderTopColorborderTopLeftRadiusborderTopRightRadiusborderTopWidthborderWidthboxShadowclassNamecolcolorcolSpancolumncolumnSpancreatedEventcssClassescssPseudoClassescssTypedisposeNativeViewEventdockdomNodeeffectiveBorderBottomWidtheffectiveBorderLeftWidtheffectiveBorderRightWidtheffectiveBorderTopWidtheffectiveHeighteffectiveLefteffectiveMarginBottomeffectiveMarginLefteffectiveMarginRighteffectiveMarginTopeffectiveMinHeighteffectiveMinWidtheffectivePaddingBottomeffectivePaddingLefteffectivePaddingRighteffectivePaddingTopeffectiveTopeffectiveWidthflexGrowflexShrinkflexWrapBeforefontSizeformattedTextheighthorizontalAlignmentidignoreTouchAnimationiosiosAccessibilityAdjustsFontSizeiosAccessibilityMaxFontScaleiosAccessibilityMinFontScaleiosIgnoreSafeAreaiosOverflowSafeAreaiosOverflowSafeAreaEnabledisCollapsedisEnabledisLayoutValidisUserInteractionEnabledlayoutChangedEventleftletterSpacinglineHeightloadedEventmarginmarginBottommarginLeftmarginRightmarginTopmaxLinesminHeightminWidthmodalnativeTextViewProtectednativeViewProtectedopacityorderoriginXoriginYpaddingpaddingBottompaddingLeftpaddingRightpaddingTopparentperspectivepropertyChangeEventrecycleNativeViewreusablerotaterotateXrotateYrowrowSpanscaleXscaleYsharedTransitionIgnoresharedTransitionTagshowingModallyEventshownModallyEventtestIDtexttextAlignmenttextDecorationtextShadowtextTransformtoptouchAnimationtouchDelaytransitionIdtranslateXtranslateYunloadedEventverticalAlignmentviewControllervisibilitywhiteSpacewidth #### Methods [dismissSoftInput](https://docs.nativescript.org/api/class/EditableTextBase#dismisssoftinput)[setSelection](https://docs.nativescript.org/api/class/EditableTextBase#setselection) 112 methods inherited from TextBase Click to expand \_addView\_addViewCore\_addViewToNativeVisualTree\_applyXmlAttribute\_batchUpdate\_childIndexToNativeChildIndex\_closeAllModalViewsInternal\_createPropertyChangeData\_dialogClosed\_eachLayoutView\_emit\_getNativeViewsCount\_getRootModalViews\_getValue\_handleLivesync\_hasAncestorView\_hideNativeModalView\_inheritStyleScope\_layoutParent\_observe\_onAttachedToWindow\_onDetachedFromWindow\_onRootViewReset\_onSizeChanged\_parentChanged\_raiseLayoutChangedEvent\_raiseShowingModallyEvent\_raiseShownModallyEvent\_removeView\_removeViewCore\_removeViewFromNativeVisualTree\_resumeNativeUpdates\_setupAsRootView\_setupUI\_setValue\_shouldDelayLayout\_showNativeModalView\_suspendNativeUpdates\_tearDownUI\_updateStyleScopeaccessibilityAnnouncementaccessibilityScreenChangedaddEventListeneraddEventListeneraddPseudoClassanimatebindcallLoadedcallUnloadedcloseModalcombineMeasuredStatescreateAnimationcreateNativeViewdeletePseudoClassdestroyNodedisposeNativeVieweachChildeachChildViewensureDomNodefocusgetgetActualSizegetGestureObserversgetLocationInWindowgetLocationOnScreengetLocationRelativeTogetMeasuredHeightgetMeasuredStategetMeasuredWidthgetSafeAreaInsetsgetViewByDomIdgetViewByIdhasGestureObservershasListenersinitNativeViewlayoutlayoutChildlayoutNativeViewloadViewmeasuremeasureChildnotifynotifyPropertyChangeoffoffonononBackPressedonceonceonLayoutonLoadedonMeasureonResumeNativeUpdatesonUnloadedremoveEventListenerremoveEventListenerrequestLayoutresetNativeViewresolveSizeAndStatesendAccessibilityEventsetsetInlineStylesetMeasuredDimensionsetNativeViewsetOnTouchListenersetPropertysetTestIDshowModaltoStringunbindunloadView ## Constructors [​](https://docs.nativescript.org/api/class/EditableTextBase\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/EditableTextBase\#constructor) ``` new EditableTextBase(): EditableTextBase ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[EditableTextBase](https://docs.nativescript.org/api/class/EditableTextBase)_ ## Properties [​](https://docs.nativescript.org/api/class/EditableTextBase\#properties) ### autocapitalizationType [​](https://docs.nativescript.org/api/class/EditableTextBase\#autocapitalizationtype) ``` autocapitalizationType: AutocapitalizationInputType ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:34:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L34) Gets or sets the autocapitalization type. ### autocorrect [​](https://docs.nativescript.org/api/class/EditableTextBase\#autocorrect) ``` autocorrect: boolean ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:49:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L49) Enables or disables autocorrection. ### autofillType [​](https://docs.nativescript.org/api/class/EditableTextBase\#autofilltype) ``` autofillType: string ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:39:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L39) Gets or sets the autofill type. ### editable [​](https://docs.nativescript.org/api/class/EditableTextBase\#editable) ``` editable: boolean ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:44:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L44) Gets or sets whether the instance is editable. ### hint [​](https://docs.nativescript.org/api/class/EditableTextBase\#hint) ``` hint: string ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:54:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L54) Gets or sets the placeholder text. ### keyboardType [​](https://docs.nativescript.org/api/class/EditableTextBase\#keyboardtype) ``` keyboardType: KeyboardInputType ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:19:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L19) Gets or sets the soft keyboard type. ### maxLength [​](https://docs.nativescript.org/api/class/EditableTextBase\#maxlength) ``` maxLength: number ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:59:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L59) Limits input to a certain number of characters. ### returnKeyType [​](https://docs.nativescript.org/api/class/EditableTextBase\#returnkeytype) ``` returnKeyType: ReturnKeyButtonType ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:24:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L24) Gets or sets the soft keyboard return key flavor. ### updateTextTrigger [​](https://docs.nativescript.org/api/class/EditableTextBase\#updatetexttrigger) ``` updateTextTrigger: UpdateTextTriggerType ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:29:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L29) Gets or sets a value indicating when the text property will be updated. ### valueFormatter [​](https://docs.nativescript.org/api/class/EditableTextBase\#valueformatter) ``` valueFormatter: (value: string) => string ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:65:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L65) ### blurEvent [​](https://docs.nativescript.org/api/class/EditableTextBase\#blurevent) Static ``` blurEvent: string ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:12:15](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L12) ### focusEvent [​](https://docs.nativescript.org/api/class/EditableTextBase\#focusevent) Static ``` focusEvent: string ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:13:15](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L13) ### textChangeEvent [​](https://docs.nativescript.org/api/class/EditableTextBase\#textchangeevent) Static ``` textChangeEvent: string ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:14:15](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L14) ## Methods [​](https://docs.nativescript.org/api/class/EditableTextBase\#methods) ### dismissSoftInput [​](https://docs.nativescript.org/api/class/EditableTextBase\#dismisssoftinput) ``` dismissSoftInput(): void ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:70:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L70) Hides the soft input method, ususally a soft keyboard. Returns _void_ ### setSelection [​](https://docs.nativescript.org/api/class/EditableTextBase\#setselection) ``` setSelection(start: number, stop?: number): any ``` defined in [@nativescript/core/ui/editable-text-base/index.d.ts:82:1](https://unpkg.com/browse/@nativescript/core//ui/editable-text-base/index.d.ts#L82) Set the selection anchor to start and the selection edge to stop | | | | | --- | --- | --- | | Parameter | Default | Description | | `start` | `` | `number` | | `stop` | `` | `number` | Returns _any_ 2. [Summary](https://docs.nativescript.org/api/class/EditableTextBase#summary) 3. [Constructors](https://docs.nativescript.org/api/class/EditableTextBase#constructors) 1. [constructor](https://docs.nativescript.org/api/class/EditableTextBase#constructor) 4. [Properties](https://docs.nativescript.org/api/class/EditableTextBase#properties) 01. [autocapitalizationType](https://docs.nativescript.org/api/class/EditableTextBase#autocapitalizationtype) 02. [autocorrect](https://docs.nativescript.org/api/class/EditableTextBase#autocorrect) 03. [autofillType](https://docs.nativescript.org/api/class/EditableTextBase#autofilltype) 04. [editable](https://docs.nativescript.org/api/class/EditableTextBase#editable) 05. [hint](https://docs.nativescript.org/api/class/EditableTextBase#hint) 06. [keyboardType](https://docs.nativescript.org/api/class/EditableTextBase#keyboardtype) 07. [maxLength](https://docs.nativescript.org/api/class/EditableTextBase#maxlength) 08. [returnKeyType](https://docs.nativescript.org/api/class/EditableTextBase#returnkeytype) 09. [updateTextTrigger](https://docs.nativescript.org/api/class/EditableTextBase#updatetexttrigger) 10. [valueFormatter](https://docs.nativescript.org/api/class/EditableTextBase#valueformatter) 11. [blurEvent](https://docs.nativescript.org/api/class/EditableTextBase#blurevent) 12. [focusEvent](https://docs.nativescript.org/api/class/EditableTextBase#focusevent) 13. [textChangeEvent](https://docs.nativescript.org/api/class/EditableTextBase#textchangeevent) 5. [Methods](https://docs.nativescript.org/api/class/EditableTextBase#methods) 1. [dismissSoftInput](https://docs.nativescript.org/api/class/EditableTextBase#dismisssoftinput) 2. [setSelection](https://docs.nativescript.org/api/class/EditableTextBase#setselection) ## NativeScript Configuration NativeScriptConfig ``` interface NativeScriptConfig { android: IConfigAndroid; appPath: string; appResourcesPath: string; cli: IConfigCLI; cssParser: "rework" | "nativescript" | "css-tree"; hooks: IConfigHook[]; id: string; ignoredNativeDependencies: string[]; ios: IConfigIOS; main: string; overridePods: string; previewAppSchema: string; profiling: InstrumentationMode; shared: boolean; webpackConfigPath: string; } ``` ## Summary [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#summary) #### Properties [android](https://docs.nativescript.org/api/interface/NativeScriptConfig#android)[appPath](https://docs.nativescript.org/api/interface/NativeScriptConfig#apppath)[appResourcesPath](https://docs.nativescript.org/api/interface/NativeScriptConfig#appresourcespath)[cli](https://docs.nativescript.org/api/interface/NativeScriptConfig#cli)[cssParser](https://docs.nativescript.org/api/interface/NativeScriptConfig#cssparser)[hooks](https://docs.nativescript.org/api/interface/NativeScriptConfig#hooks)[id](https://docs.nativescript.org/api/interface/NativeScriptConfig#id)[ignoredNativeDependencies](https://docs.nativescript.org/api/interface/NativeScriptConfig#ignorednativedependencies)[ios](https://docs.nativescript.org/api/interface/NativeScriptConfig#ios)[main](https://docs.nativescript.org/api/interface/NativeScriptConfig#main)[overridePods](https://docs.nativescript.org/api/interface/NativeScriptConfig#overridepods)[previewAppSchema](https://docs.nativescript.org/api/interface/NativeScriptConfig#previewappschema)[profiling](https://docs.nativescript.org/api/interface/NativeScriptConfig#profiling)[shared](https://docs.nativescript.org/api/interface/NativeScriptConfig#shared)[webpackConfigPath](https://docs.nativescript.org/api/interface/NativeScriptConfig#webpackconfigpath) ## Properties [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#properties) ### android [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#android) ``` android?: IConfigAndroid ``` defined in [@nativescript/core/config/config.interface.d.ts:167:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L167) Android specific configurations Various Android specific configurations including Android runtime flags. ### appPath [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#apppath) ``` appPath?: string ``` defined in [@nativescript/core/config/config.interface.d.ts:144:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L144) Path to the app source directory This is often the `` `src` `` or `` `app` `` directory however can be changed. ### appResourcesPath [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#appresourcespath) ``` appResourcesPath?: string ``` defined in [@nativescript/core/config/config.interface.d.ts:149:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L149) App\_Resources path This is often at the root or inside `` `src` `` or `` `app` `` directory however can be anywhere. ### cli [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#cli) ``` cli?: IConfigCLI ``` defined in [@nativescript/core/config/config.interface.d.ts:185:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L185) Set cli options ### cssParser [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#cssparser) ``` cssParser?: "rework" | "nativescript" | "css-tree" ``` defined in [@nativescript/core/config/config.interface.d.ts:177:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L177) Set the default CSS parser that NativeScript will use. Default: css-tree ### hooks [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#hooks) ``` hooks?: IConfigHook[] ``` defined in [@nativescript/core/config/config.interface.d.ts:189:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L189) Set project persistent hooks to run ### id [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#id) ``` id?: string ``` defined in [@nativescript/core/config/config.interface.d.ts:135:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L135) App's bundle id Used for both iOS and Android if they use the same bundle id. You can override per platform in the respective platform specific configurations. ### ignoredNativeDependencies [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#ignorednativedependencies) ``` ignoredNativeDependencies?: string[] ``` defined in [@nativescript/core/config/config.interface.d.ts:181:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L181) Optionally specify a list of npm package names for which you would like the NativeScript CLI to ignore when attaching native dependencies to the build ### ios [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#ios) ``` ios?: IConfigIOS ``` defined in [@nativescript/core/config/config.interface.d.ts:162:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L162) iOS specific configurations Various iOS specific configurations including iOS runtime flags. ### main [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#main) ``` main?: string ``` defined in [@nativescript/core/config/config.interface.d.ts:139:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L139) App's main entry file - this setting overrides the value set in package.json ### overridePods [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#overridepods) ``` overridePods?: string ``` defined in [@nativescript/core/config/config.interface.d.ts:152:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L152) ### previewAppSchema [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#previewappschema) ``` previewAppSchema?: string ``` defined in [@nativescript/core/config/config.interface.d.ts:151:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L151) ### profiling [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#profiling) ``` profiling?: InstrumentationMode ``` defined in [@nativescript/core/config/config.interface.d.ts:172:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L172) Enable profiling for the application. Default: no profiling In most cases when profiling, you will want to use "timeline" ### shared [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#shared) ``` shared?: boolean ``` defined in [@nativescript/core/config/config.interface.d.ts:150:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L150) ### webpackConfigPath [​](https://docs.nativescript.org/api/interface/NativeScriptConfig\#webpackconfigpath) ``` webpackConfigPath?: string ``` defined in [@nativescript/core/config/config.interface.d.ts:157:4](https://unpkg.com/browse/@nativescript/core//config/config.interface.d.ts#L157) Custom webpack config path The default is `` `webpack.config.js` `` in the root however you can use a custom name and place elsewhere. 2. [Summary](https://docs.nativescript.org/api/interface/NativeScriptConfig#summary) 3. [Properties](https://docs.nativescript.org/api/interface/NativeScriptConfig#properties) 01. [android](https://docs.nativescript.org/api/interface/NativeScriptConfig#android) 02. [appPath](https://docs.nativescript.org/api/interface/NativeScriptConfig#apppath) 03. [appResourcesPath](https://docs.nativescript.org/api/interface/NativeScriptConfig#appresourcespath) 04. [cli](https://docs.nativescript.org/api/interface/NativeScriptConfig#cli) 05. [cssParser](https://docs.nativescript.org/api/interface/NativeScriptConfig#cssparser) 06. [hooks](https://docs.nativescript.org/api/interface/NativeScriptConfig#hooks) 07. [id](https://docs.nativescript.org/api/interface/NativeScriptConfig#id) 08. [ignoredNativeDependencies](https://docs.nativescript.org/api/interface/NativeScriptConfig#ignorednativedependencies) 09. [ios](https://docs.nativescript.org/api/interface/NativeScriptConfig#ios) 10. [main](https://docs.nativescript.org/api/interface/NativeScriptConfig#main) 11. [overridePods](https://docs.nativescript.org/api/interface/NativeScriptConfig#overridepods) 12. [previewAppSchema](https://docs.nativescript.org/api/interface/NativeScriptConfig#previewappschema) 13. [profiling](https://docs.nativescript.org/api/interface/NativeScriptConfig#profiling) 14. [shared](https://docs.nativescript.org/api/interface/NativeScriptConfig#shared) 15. [webpackConfigPath](https://docs.nativescript.org/api/interface/NativeScriptConfig#webpackconfigpath) ## ShorthandProperty Class ShorthandProperty ## Summary [​](https://docs.nativescript.org/api/class/ShorthandProperty\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/ShorthandProperty#constructor) #### Properties [cssLocalName](https://docs.nativescript.org/api/class/ShorthandProperty#csslocalname)[cssName](https://docs.nativescript.org/api/class/ShorthandProperty#cssname)[cssValueDescriptor](https://docs.nativescript.org/api/class/ShorthandProperty#cssvaluedescriptor)[key](https://docs.nativescript.org/api/class/ShorthandProperty#key)[localValueDescriptor](https://docs.nativescript.org/api/class/ShorthandProperty#localvaluedescriptor)[name](https://docs.nativescript.org/api/class/ShorthandProperty#name)[propertyBagDescriptor](https://docs.nativescript.org/api/class/ShorthandProperty#propertybagdescriptor)[sourceKey](https://docs.nativescript.org/api/class/ShorthandProperty#sourcekey) #### Methods [register](https://docs.nativescript.org/api/class/ShorthandProperty#register) ## Constructors [​](https://docs.nativescript.org/api/class/ShorthandProperty\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/ShorthandProperty\#constructor) ``` new ShorthandProperty(options: ShorthandPropertyOptions

): ShorthandProperty ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:131:4](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L131) | | | | | --- | --- | --- | | Parameter | Default | Description | | `options` | `` | `ShorthandPropertyOptions

` | Returns _[ShorthandProperty](https://docs.nativescript.org/api/class/ShorthandProperty) _ ## Properties [​](https://docs.nativescript.org/api/class/ShorthandProperty\#properties) ### cssLocalName [​](https://docs.nativescript.org/api/class/ShorthandProperty\#csslocalname) Readonly ``` cssLocalName: string ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:126:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L126) ### cssName [​](https://docs.nativescript.org/api/class/ShorthandProperty\#cssname) Readonly ``` cssName: string ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:125:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L125) ### cssValueDescriptor [​](https://docs.nativescript.org/api/class/ShorthandProperty\#cssvaluedescriptor) ProtectedReadonly ``` cssValueDescriptor: PropertyDescriptor ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:127:23](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L127) ### key [​](https://docs.nativescript.org/api/class/ShorthandProperty\#key) Readonly ``` key: symbol ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:123:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L123) ### localValueDescriptor [​](https://docs.nativescript.org/api/class/ShorthandProperty\#localvaluedescriptor) ProtectedReadonly ``` localValueDescriptor: PropertyDescriptor ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:128:23](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L128) ### name [​](https://docs.nativescript.org/api/class/ShorthandProperty\#name) Readonly ``` name: string ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:124:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L124) ### propertyBagDescriptor [​](https://docs.nativescript.org/api/class/ShorthandProperty\#propertybagdescriptor) ProtectedReadonly ``` propertyBagDescriptor: PropertyDescriptor ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:129:23](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L129) ### sourceKey [​](https://docs.nativescript.org/api/class/ShorthandProperty\#sourcekey) Readonly ``` sourceKey: symbol ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:130:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L130) ## Methods [​](https://docs.nativescript.org/api/class/ShorthandProperty\#methods) ### register [​](https://docs.nativescript.org/api/class/ShorthandProperty\#register) ``` register(cls: typeof Style): void ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:132:4](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L132) | | | | | --- | --- | --- | | Parameter | Default | Description | | `cls` | `` | `typeof Style` | Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/ShorthandProperty#summary) 3. [Constructors](https://docs.nativescript.org/api/class/ShorthandProperty#constructors) 1. [constructor](https://docs.nativescript.org/api/class/ShorthandProperty#constructor) 4. [Properties](https://docs.nativescript.org/api/class/ShorthandProperty#properties) 1. [cssLocalName](https://docs.nativescript.org/api/class/ShorthandProperty#csslocalname) 2. [cssName](https://docs.nativescript.org/api/class/ShorthandProperty#cssname) 3. [cssValueDescriptor](https://docs.nativescript.org/api/class/ShorthandProperty#cssvaluedescriptor) 4. [key](https://docs.nativescript.org/api/class/ShorthandProperty#key) 5. [localValueDescriptor](https://docs.nativescript.org/api/class/ShorthandProperty#localvaluedescriptor) 6. [name](https://docs.nativescript.org/api/class/ShorthandProperty#name) 7. [propertyBagDescriptor](https://docs.nativescript.org/api/class/ShorthandProperty#propertybagdescriptor) 8. [sourceKey](https://docs.nativescript.org/api/class/ShorthandProperty#sourcekey) 5. [Methods](https://docs.nativescript.org/api/class/ShorthandProperty#methods) 1. [register](https://docs.nativescript.org/api/class/ShorthandProperty#register) ## Root View Controller RootViewControllerImpl ``` interface RootViewControllerImpl { /** @deprecated */ contentController: any; } ``` ## Summary [​](https://docs.nativescript.org/api/interface/RootViewControllerImpl\#summary) #### Properties [contentController](https://docs.nativescript.org/api/interface/RootViewControllerImpl#contentcontroller) ## Properties [​](https://docs.nativescript.org/api/interface/RootViewControllerImpl\#properties) ### contentController [​](https://docs.nativescript.org/api/interface/RootViewControllerImpl\#contentcontroller) ``` contentController: any ``` defined in [@nativescript/core/application/application-interfaces.d.ts:181:4](https://unpkg.com/browse/@nativescript/core//application/application-interfaces.d.ts#L181) Next [AccessibilityEvents→](https://docs.nativescript.org/api/namespace/AccessibilityEvents) 2. [Summary](https://docs.nativescript.org/api/interface/RootViewControllerImpl#summary) 3. [Properties](https://docs.nativescript.org/api/interface/RootViewControllerImpl#properties) 1. [contentController](https://docs.nativescript.org/api/interface/RootViewControllerImpl#contentcontroller) ## HttpContent Interface HttpContent ``` interface HttpContent { raw: any; toArrayBuffer: () => ArrayBuffer; toFile: (destinationFilePath?: string) => File; toImage: () => Promise; toJSON: (encoding?: HttpResponseEncoding) => any; toString: (encoding?: HttpResponseEncoding) => string; } ``` Encapsulates the content of an HttpResponse. ## Summary [​](https://docs.nativescript.org/api/interface/HttpContent\#summary) #### Properties [raw](https://docs.nativescript.org/api/interface/HttpContent#raw)[toArrayBuffer](https://docs.nativescript.org/api/interface/HttpContent#toarraybuffer)[toFile](https://docs.nativescript.org/api/interface/HttpContent#tofile)[toImage](https://docs.nativescript.org/api/interface/HttpContent#toimage)[toJSON](https://docs.nativescript.org/api/interface/HttpContent#tojson)[toString](https://docs.nativescript.org/api/interface/HttpContent#tostring) ## Properties [​](https://docs.nativescript.org/api/interface/HttpContent\#properties) ### raw [​](https://docs.nativescript.org/api/interface/HttpContent\#raw) ``` raw: any ``` defined in [@nativescript/core/http/index.d.ts:140:1](https://unpkg.com/browse/@nativescript/core//http/index.d.ts#L140) Gets the response body as raw data. ### toArrayBuffer [​](https://docs.nativescript.org/api/interface/HttpContent\#toarraybuffer) ``` toArrayBuffer: () => ArrayBuffer ``` defined in [@nativescript/core/http/index.d.ts:145:1](https://unpkg.com/browse/@nativescript/core//http/index.d.ts#L145) ### toFile [​](https://docs.nativescript.org/api/interface/HttpContent\#tofile) ``` toFile: (destinationFilePath?: string) => File ``` defined in [@nativescript/core/http/index.d.ts:165:1](https://unpkg.com/browse/@nativescript/core//http/index.d.ts#L165) ### toImage [​](https://docs.nativescript.org/api/interface/HttpContent\#toimage) ``` toImage: () => Promise ``` defined in [@nativescript/core/http/index.d.ts:160:1](https://unpkg.com/browse/@nativescript/core//http/index.d.ts#L160) ### toJSON [​](https://docs.nativescript.org/api/interface/HttpContent\#tojson) ``` toJSON: (encoding?: HttpResponseEncoding) => any ``` defined in [@nativescript/core/http/index.d.ts:155:1](https://unpkg.com/browse/@nativescript/core//http/index.d.ts#L155) ### toString [​](https://docs.nativescript.org/api/interface/HttpContent\#tostring) ``` toString: (encoding?: HttpResponseEncoding) => string ``` defined in [@nativescript/core/http/index.d.ts:150:1](https://unpkg.com/browse/@nativescript/core//http/index.d.ts#L150) 2. [Summary](https://docs.nativescript.org/api/interface/HttpContent#summary) 3. [Properties](https://docs.nativescript.org/api/interface/HttpContent#properties) 1. [raw](https://docs.nativescript.org/api/interface/HttpContent#raw) 2. [toArrayBuffer](https://docs.nativescript.org/api/interface/HttpContent#toarraybuffer) 3. [toFile](https://docs.nativescript.org/api/interface/HttpContent#tofile) 4. [toImage](https://docs.nativescript.org/api/interface/HttpContent#toimage) 5. [toJSON](https://docs.nativescript.org/api/interface/HttpContent#tojson) 6. [toString](https://docs.nativescript.org/api/interface/HttpContent#tostring) ## Proxy View Container [LayoutBase](https://docs.nativescript.org/api/class/LayoutBase) ProxyViewContainer Proxy view container that adds all its native children directly to the parent. To be used as a logical grouping container of views. ## Summary [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/ProxyViewContainer#constructor) #### Accessors [android](https://docs.nativescript.org/api/class/ProxyViewContainer#android)[ios](https://docs.nativescript.org/api/class/ProxyViewContainer#ios)[isLayoutRequested](https://docs.nativescript.org/api/class/ProxyViewContainer#islayoutrequested) 11 accessors inherited from LayoutBase Click to expand backgroundPositionbackgroundRepeatbackgroundSizeclassisLoadednativeViewpageparentNodestyletextTransformtypeName #### Methods [\_addViewToNativeVisualTree](https://docs.nativescript.org/api/class/ProxyViewContainer#addviewtonativevisualtree)[\_changedLayoutProperty](https://docs.nativescript.org/api/class/ProxyViewContainer#changedlayoutproperty)[\_eachLayoutView](https://docs.nativescript.org/api/class/ProxyViewContainer#eachlayoutview)[\_getNativeViewsCount](https://docs.nativescript.org/api/class/ProxyViewContainer#getnativeviewscount)[\_parentChanged](https://docs.nativescript.org/api/class/ProxyViewContainer#parentchanged)[\_registerLayoutChild](https://docs.nativescript.org/api/class/ProxyViewContainer#registerlayoutchild)[\_removeViewFromNativeVisualTree](https://docs.nativescript.org/api/class/ProxyViewContainer#removeviewfromnativevisualtree)[\_setupUI](https://docs.nativescript.org/api/class/ProxyViewContainer#setupui)[\_tearDownUI](https://docs.nativescript.org/api/class/ProxyViewContainer#teardownui)[\_unregisterLayoutChild](https://docs.nativescript.org/api/class/ProxyViewContainer#unregisterlayoutchild)[createNativeView](https://docs.nativescript.org/api/class/ProxyViewContainer#createnativeview) 112 methods inherited from LayoutBase Click to expand \_addView\_addViewCore\_applyXmlAttribute\_batchUpdate\_childIndexToNativeChildIndex\_closeAllModalViewsInternal\_createPropertyChangeData\_dialogClosed\_emit\_getRootModalViews\_getValue\_handleLivesync\_hasAncestorView\_hideNativeModalView\_inheritStyleScope\_layoutParent\_observe\_onAttachedToWindow\_onDetachedFromWindow\_onRootViewReset\_onSizeChanged\_raiseLayoutChangedEvent\_raiseShowingModallyEvent\_raiseShownModallyEvent\_removeView\_removeViewCore\_resumeNativeUpdates\_setupAsRootView\_setValue\_shouldDelayLayout\_showNativeModalView\_suspendNativeUpdates\_updateStyleScopeaccessibilityAnnouncementaccessibilityScreenChangedaddChildaddEventListeneraddEventListeneraddPseudoClassanimatebindcallLoadedcallUnloadedcloseModalcombineMeasuredStatescreateAnimationdeletePseudoClassdestroyNodedisposeNativeVieweachChildeachChildVieweachLayoutChildensureDomNodefocusgetgetActualSizegetChildAtgetChildIndexgetChildrenCountgetGestureObserversgetLocationInWindowgetLocationOnScreengetLocationRelativeTogetMeasuredHeightgetMeasuredStategetMeasuredWidthgetSafeAreaInsetsgetViewByDomIdgetViewByIdhasGestureObservershasListenersinitNativeViewinsertChildlayoutlayoutChildlayoutNativeViewloadViewmeasuremeasureChildnotifynotifyPropertyChangeoffoffonononBackPressedonceonceonLayoutonLoadedonMeasureonResumeNativeUpdatesonUnloadedremoveChildremoveChildrenremoveEventListenerremoveEventListenerrequestLayoutresetNativeViewresolveSizeAndStatesendAccessibilityEventsetsetInlineStylesetMeasuredDimensionsetNativeViewsetOnTouchListenersetPropertysetTestIDshowModaltoStringunbindunloadView ## Constructors [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#constructor) ``` new ProxyViewContainer(): ProxyViewContainer ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:9:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L9) Returns _[ProxyViewContainer](https://docs.nativescript.org/api/class/ProxyViewContainer)_ ## Accessors [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#accessors) ### android [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#android) ``` get android(): any ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:11:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L11) Returns _any_ ### ios [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#ios) ``` get ios(): any ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:10:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L10) Returns _any_ ### isLayoutRequested [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#islayoutrequested) ``` get isLayoutRequested(): boolean ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:12:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L12) Returns _boolean_ ## Methods [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#methods) ### \_addViewToNativeVisualTree [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#addviewtonativevisualtree) ``` _addViewToNativeVisualTree(child: View, atIndex?: number): boolean ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:18:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L18) | | | | | --- | --- | --- | | Parameter | Default | Description | | `child` | `` | `View` | | `atIndex` | `` | `number` | Returns _boolean_ ### \_changedLayoutProperty [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#changedlayoutproperty) ``` _changedLayoutProperty(propName: string, value: string): void ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:26:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L26) Layout property changed, proxy the new value to the child view(s) | | | | | --- | --- | --- | | Parameter | Default | Description | | `propName` | `` | `string` | | `value` | `` | `string` | Returns _void_ ### \_eachLayoutView [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#eachlayoutview) ``` _eachLayoutView(callback: (View: any) => void): void ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:15:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L15) | | | | | --- | --- | --- | | Parameter | Default | Description | | `callback` | `` | `(View: any) => void` | Returns _void_ ### \_getNativeViewsCount [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#getnativeviewscount) ``` _getNativeViewsCount(): number ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:14:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L14) Returns _number_ ### \_parentChanged [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#parentchanged) ``` _parentChanged(oldParent: View): void ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:22:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L22) | | | | | --- | --- | --- | | Parameter | Default | Description | | `oldParent` | `` | `View` | Returns _void_ ### \_registerLayoutChild [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#registerlayoutchild) ``` _registerLayoutChild(child: View): void ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:20:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L20) | | | | | --- | --- | --- | | Parameter | Default | Description | | `child` | `` | `View` | Returns _void_ ### \_removeViewFromNativeVisualTree [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#removeviewfromnativevisualtree) ``` _removeViewFromNativeVisualTree(child: View): void ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:19:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L19) | | | | | --- | --- | --- | | Parameter | Default | Description | | `child` | `` | `View` | Returns _void_ ### \_setupUI [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#setupui) ``` _setupUI(context: any, atIndex?: number, parentIsLoaded?: boolean): void ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:16:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L16) | | | | | --- | --- | --- | | Parameter | Default | Description | | `context` | `` | `any` | | `atIndex` | `` | `number` | | `parentIsLoaded` | `` | `boolean` | Returns _void_ ### \_tearDownUI [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#teardownui) ``` _tearDownUI(force?: boolean): void ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:17:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L17) | | | | | --- | --- | --- | | Parameter | Default | Description | | `force` | `` | `boolean` | Returns _void_ ### \_unregisterLayoutChild [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#unregisterlayoutchild) ``` _unregisterLayoutChild(child: View): void ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:21:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L21) | | | | | --- | --- | --- | | Parameter | Default | Description | | `child` | `` | `View` | Returns _void_ ### createNativeView [​](https://docs.nativescript.org/api/class/ProxyViewContainer\#createnativeview) ``` createNativeView(): any ``` defined in [@nativescript/core/ui/proxy-view-container/index.d.ts:13:4](https://unpkg.com/browse/@nativescript/core//ui/proxy-view-container/index.d.ts#L13) Returns _any_ 2. [Summary](https://docs.nativescript.org/api/class/ProxyViewContainer#summary) 3. [Constructors](https://docs.nativescript.org/api/class/ProxyViewContainer#constructors) 1. [constructor](https://docs.nativescript.org/api/class/ProxyViewContainer#constructor) 4. [Accessors](https://docs.nativescript.org/api/class/ProxyViewContainer#accessors) 1. [android](https://docs.nativescript.org/api/class/ProxyViewContainer#android) 2. [ios](https://docs.nativescript.org/api/class/ProxyViewContainer#ios) 3. [isLayoutRequested](https://docs.nativescript.org/api/class/ProxyViewContainer#islayoutrequested) 5. [Methods](https://docs.nativescript.org/api/class/ProxyViewContainer#methods) 01. [\_addViewToNativeVisualTree](https://docs.nativescript.org/api/class/ProxyViewContainer#addviewtonativevisualtree) 02. [\_changedLayoutProperty](https://docs.nativescript.org/api/class/ProxyViewContainer#changedlayoutproperty) 03. [\_eachLayoutView](https://docs.nativescript.org/api/class/ProxyViewContainer#eachlayoutview) 04. [\_getNativeViewsCount](https://docs.nativescript.org/api/class/ProxyViewContainer#getnativeviewscount) 05. [\_parentChanged](https://docs.nativescript.org/api/class/ProxyViewContainer#parentchanged) 06. [\_registerLayoutChild](https://docs.nativescript.org/api/class/ProxyViewContainer#registerlayoutchild) 07. [\_removeViewFromNativeVisualTree](https://docs.nativescript.org/api/class/ProxyViewContainer#removeviewfromnativevisualtree) 08. [\_setupUI](https://docs.nativescript.org/api/class/ProxyViewContainer#setupui) 09. [\_tearDownUI](https://docs.nativescript.org/api/class/ProxyViewContainer#teardownui) 10. [\_unregisterLayoutChild](https://docs.nativescript.org/api/class/ProxyViewContainer#unregisterlayoutchild) 11. [createNativeView](https://docs.nativescript.org/api/class/ProxyViewContainer#createnativeview) ## ListPicker Component [View](https://docs.nativescript.org/api/class/View) ListPicker Represents an list picker. ## Summary [​](https://docs.nativescript.org/api/class/ListPicker\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/ListPicker#constructor) #### Properties [android](https://docs.nativescript.org/api/class/ListPicker#android)[ios](https://docs.nativescript.org/api/class/ListPicker#ios)[items](https://docs.nativescript.org/api/class/ListPicker#items)[selectedIndex](https://docs.nativescript.org/api/class/ListPicker#selectedindex) ## Constructors [​](https://docs.nativescript.org/api/class/ListPicker\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/ListPicker\#constructor) ``` new ListPicker(): ListPicker ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[ListPicker](https://docs.nativescript.org/api/class/ListPicker)_ ## Properties [​](https://docs.nativescript.org/api/class/ListPicker\#properties) ### android [​](https://docs.nativescript.org/api/class/ListPicker\#android) ``` android: any ``` defined in [@nativescript/core/ui/list-picker/index.d.ts:12:1](https://unpkg.com/browse/@nativescript/core//ui/list-picker/index.d.ts#L12) Gets the native \[android.widget.NumberPicker\](http://developer.android.com/reference/android/widget/NumberPicker.html) that represents the user interface for this component. Valid only when running on Android OS. ### ios [​](https://docs.nativescript.org/api/class/ListPicker\#ios) ``` ios: any ``` defined in [@nativescript/core/ui/list-picker/index.d.ts:17:1](https://unpkg.com/browse/@nativescript/core//ui/list-picker/index.d.ts#L17) Gets the native iOS \[UIPickerView\](http://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIDatePicker\_Class/index.html) that represents the user interface for this component. Valid only when running on iOS. ### items [​](https://docs.nativescript.org/api/class/ListPicker\#items) ``` items: any ``` defined in [@nativescript/core/ui/list-picker/index.d.ts:28:1](https://unpkg.com/browse/@nativescript/core//ui/list-picker/index.d.ts#L28) Gets or set the items collection of the ListPicker. The items property can be set to an array or an object defining length and getItem(index) method. ### selectedIndex [​](https://docs.nativescript.org/api/class/ListPicker\#selectedindex) ``` selectedIndex: number ``` defined in [@nativescript/core/ui/list-picker/index.d.ts:22:1](https://unpkg.com/browse/@nativescript/core//ui/list-picker/index.d.ts#L22) Gets or sets the selected index. 2. [Summary](https://docs.nativescript.org/api/class/ListPicker#summary) 3. [Constructors](https://docs.nativescript.org/api/class/ListPicker#constructors) 1. [constructor](https://docs.nativescript.org/api/class/ListPicker#constructor) 4. [Properties](https://docs.nativescript.org/api/class/ListPicker#properties) 1. [android](https://docs.nativescript.org/api/class/ListPicker#android) 2. [ios](https://docs.nativescript.org/api/class/ListPicker#ios) 3. [items](https://docs.nativescript.org/api/class/ListPicker#items) 4. [selectedIndex](https://docs.nativescript.org/api/class/ListPicker#selectedindex) ## InheritedProperty Class [Property](https://docs.nativescript.org/api/class/Property) InheritedProperty ## Summary [​](https://docs.nativescript.org/api/class/InheritedProperty\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/InheritedProperty#constructor) #### Properties [setInheritedValue](https://docs.nativescript.org/api/class/InheritedProperty#setinheritedvalue)[sourceKey](https://docs.nativescript.org/api/class/InheritedProperty#sourcekey) 13 properties inherited from Property Click to expand configurabledefaultValuedefaultValueKeyenumerablegetgetDefaultisStylePropertykeynamenativeValueChangeoverrideHandlerssetsetNative ## Constructors [​](https://docs.nativescript.org/api/class/InheritedProperty\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/InheritedProperty\#constructor) ``` new InheritedProperty(options: PropertyOptions): InheritedProperty ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:71:4](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L71) | | | | | --- | --- | --- | | Parameter | Default | Description | | `options` | `` | `PropertyOptions` | Returns _[InheritedProperty](https://docs.nativescript.org/api/class/InheritedProperty) _ ## Properties [​](https://docs.nativescript.org/api/class/InheritedProperty\#properties) ### setInheritedValue [​](https://docs.nativescript.org/api/class/InheritedProperty\#setinheritedvalue) Readonly ``` setInheritedValue: (value: U) => void ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:70:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L70) ### sourceKey [​](https://docs.nativescript.org/api/class/InheritedProperty\#sourcekey) Readonly ``` sourceKey: symbol ``` defined in [@nativescript/core/ui/core/properties/index.d.ts:69:13](https://unpkg.com/browse/@nativescript/core//ui/core/properties/index.d.ts#L69) 2. [Summary](https://docs.nativescript.org/api/class/InheritedProperty#summary) 3. [Constructors](https://docs.nativescript.org/api/class/InheritedProperty#constructors) 1. [constructor](https://docs.nativescript.org/api/class/InheritedProperty#constructor) 4. [Properties](https://docs.nativescript.org/api/class/InheritedProperty#properties) 1. [setInheritedValue](https://docs.nativescript.org/api/class/InheritedProperty#setinheritedvalue) 2. [sourceKey](https://docs.nativescript.org/api/class/InheritedProperty#sourcekey) ## Accessibility Roles Overview ## Summary [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#summary) #### Enumeration Members [Adjustable](https://docs.nativescript.org/api/enum/AccessibilityRole#adjustable)[Button](https://docs.nativescript.org/api/enum/AccessibilityRole#button)[Checkbox](https://docs.nativescript.org/api/enum/AccessibilityRole#checkbox)[Header](https://docs.nativescript.org/api/enum/AccessibilityRole#header)[Image](https://docs.nativescript.org/api/enum/AccessibilityRole#image)[ImageButton](https://docs.nativescript.org/api/enum/AccessibilityRole#imagebutton)[KeyboardKey](https://docs.nativescript.org/api/enum/AccessibilityRole#keyboardkey)[Link](https://docs.nativescript.org/api/enum/AccessibilityRole#link)[None](https://docs.nativescript.org/api/enum/AccessibilityRole#none)[PlaysSound](https://docs.nativescript.org/api/enum/AccessibilityRole#playssound)[ProgressBar](https://docs.nativescript.org/api/enum/AccessibilityRole#progressbar)[RadioButton](https://docs.nativescript.org/api/enum/AccessibilityRole#radiobutton)[Search](https://docs.nativescript.org/api/enum/AccessibilityRole#search)[SpinButton](https://docs.nativescript.org/api/enum/AccessibilityRole#spinbutton)[StartsMediaSession](https://docs.nativescript.org/api/enum/AccessibilityRole#startsmediasession)[StaticText](https://docs.nativescript.org/api/enum/AccessibilityRole#statictext)[Summary](https://docs.nativescript.org/api/enum/AccessibilityRole#summary)[Switch](https://docs.nativescript.org/api/enum/AccessibilityRole#switch) ## Enumeration Members [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#enumeration-members) ### Adjustable [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#adjustable) ``` Adjustable: "adjustable" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:29:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L29) The element allows continuous adjustment through a range of values. ### Button [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#button) ``` Button: "button" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:33:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L33) The element should be treated as a button. ### Checkbox [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#checkbox) ``` Checkbox: "checkbox" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:37:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L37) The element behaves like a Checkbox ``` Header: "header" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:41:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L41) The element is a header that divides content into sections, such as the title of a navigation bar. ### Image [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#image) ``` Image: "image" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:45:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L45) The element should be treated as an image. ### ImageButton [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#imagebutton) ``` ImageButton: "imageButton" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:49:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L49) The element should be treated as a image button. ### KeyboardKey [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#keyboardkey) ``` KeyboardKey: "keyboardKey" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:53:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L53) The element behaves as a keyboard key. ### Link [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#link) ``` Link: "link" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:57:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L57) The element should be treated as a link. ### None [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#none) ``` None: "none" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:61:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L61) The element has no traits. ### PlaysSound [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#playssound) ``` PlaysSound: "plays" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:65:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L65) The element plays its own sound when activated. ### ProgressBar [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#progressbar) ``` ProgressBar: "progressBar" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:69:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L69) The element behaves like a ProgressBar ### RadioButton [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#radiobutton) ``` RadioButton: "radioButton" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:73:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L73) The element behaves like a RadioButton ### Search [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#search) ``` Search: "search" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:77:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L77) The element should be treated as a search field. ### SpinButton [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#spinbutton) ``` SpinButton: "spinButton" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:81:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L81) The element behaves like a SpinButton ### StartsMediaSession [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#startsmediasession) ``` StartsMediaSession: "startsMedia" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:85:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L85) The element starts a media session when it is activated. ### StaticText [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#statictext) ``` StaticText: "text" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:89:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L89) The element should be treated as static text that cannot change. ### Summary [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#summary-1) ``` Summary: "summary" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:93:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L93) The element provides summary information when the application starts. ### Switch [​](https://docs.nativescript.org/api/enum/AccessibilityRole\#switch) ``` Switch: "switch" ``` defined in [@nativescript/core/accessibility/accessibility-types.d.ts:97:4](https://unpkg.com/browse/@nativescript/core//accessibility/accessibility-types.d.ts#L97) The element behaves like a switch 2. [Summary](https://docs.nativescript.org/api/enum/AccessibilityRole#summary) 3. [Enumeration Members](https://docs.nativescript.org/api/enum/AccessibilityRole#enumeration-members) 01. [Adjustable](https://docs.nativescript.org/api/enum/AccessibilityRole#adjustable) 02. [Button](https://docs.nativescript.org/api/enum/AccessibilityRole#button) 03. [Checkbox](https://docs.nativescript.org/api/enum/AccessibilityRole#checkbox) 04. [Header](https://docs.nativescript.org/api/enum/AccessibilityRole#header) 05. [Image](https://docs.nativescript.org/api/enum/AccessibilityRole#image) 06. [ImageButton](https://docs.nativescript.org/api/enum/AccessibilityRole#imagebutton) 07. [KeyboardKey](https://docs.nativescript.org/api/enum/AccessibilityRole#keyboardkey) 08. [Link](https://docs.nativescript.org/api/enum/AccessibilityRole#link) 09. [None](https://docs.nativescript.org/api/enum/AccessibilityRole#none) 10. [PlaysSound](https://docs.nativescript.org/api/enum/AccessibilityRole#playssound) 11. [ProgressBar](https://docs.nativescript.org/api/enum/AccessibilityRole#progressbar) 12. [RadioButton](https://docs.nativescript.org/api/enum/AccessibilityRole#radiobutton) 13. [Search](https://docs.nativescript.org/api/enum/AccessibilityRole#search) 14. [SpinButton](https://docs.nativescript.org/api/enum/AccessibilityRole#spinbutton) 15. [StartsMediaSession](https://docs.nativescript.org/api/enum/AccessibilityRole#startsmediasession) 16. [StaticText](https://docs.nativescript.org/api/enum/AccessibilityRole#statictext) 17. [Summary](https://docs.nativescript.org/api/enum/AccessibilityRole#summary-1) 18. [Switch](https://docs.nativescript.org/api/enum/AccessibilityRole#switch) ## SegmentedBarItem Class [ViewBase](https://docs.nativescript.org/api/class/ViewBase) SegmentedBarItem Represents a SegmentedBar item. ## Summary [​](https://docs.nativescript.org/api/class/SegmentedBarItem\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/SegmentedBarItem#constructor) #### Properties [title](https://docs.nativescript.org/api/class/SegmentedBarItem#title) 69 properties inherited from ViewBase Click to expand \_automaticallyAdjustsScrollViewInsets\_context\_cssState\_defaultPaddingBottom\_defaultPaddingLeft\_defaultPaddingRight\_defaultPaddingTop\_domId\_ignoreFlexMinWidthHeightReset\_isAddedToNativeVisualTree\_isPaddingRelative\_isStyleScopeHost\_oldBottom\_oldLeft\_oldRight\_oldTop\_styleScope\_suspendNativeUpdatesCountalignSelfbindingContextclassNamecolcolSpancolumncolumnSpancreatedEventcssClassescssPseudoClassesdisposeNativeViewEventdockdomNodeeffectiveBorderBottomWidtheffectiveBorderLeftWidtheffectiveBorderRightWidtheffectiveBorderTopWidtheffectiveHeighteffectiveLefteffectiveMarginBottomeffectiveMarginLefteffectiveMarginRighteffectiveMarginTopeffectiveMinHeighteffectiveMinWidtheffectivePaddingBottomeffectivePaddingLefteffectivePaddingRighteffectivePaddingTopeffectiveTopeffectiveWidthflexGrowflexShrinkflexWrapBeforeidisCollapsedleftloadedEventnativeViewProtectedorderparentpropertyChangeEventrecycleNativeViewreusablerowrowSpansharedTransitionIgnoresharedTransitionTagtopunloadedEventviewController ## Constructors [​](https://docs.nativescript.org/api/class/SegmentedBarItem\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/SegmentedBarItem\#constructor) ``` new SegmentedBarItem(): SegmentedBarItem ``` inherited from defined in [@nativescript/core/ui/core/view-base/index.d.ts:263:4](https://unpkg.com/browse/@nativescript/core//ui/core/view-base/index.d.ts#L263) Returns _[SegmentedBarItem](https://docs.nativescript.org/api/class/SegmentedBarItem)_ ## Properties [​](https://docs.nativescript.org/api/class/SegmentedBarItem\#properties) ### title [​](https://docs.nativescript.org/api/class/SegmentedBarItem\#title) ``` title: string ``` defined in [@nativescript/core/ui/segmented-bar/index.d.ts:15:8](https://unpkg.com/browse/@nativescript/core//ui/segmented-bar/index.d.ts#L15) Gets or sets the title of the SegmentedBarItem. 2. [Summary](https://docs.nativescript.org/api/class/SegmentedBarItem#summary) 3. [Constructors](https://docs.nativescript.org/api/class/SegmentedBarItem#constructors) 1. [constructor](https://docs.nativescript.org/api/class/SegmentedBarItem#constructor) 4. [Properties](https://docs.nativescript.org/api/class/SegmentedBarItem#properties) 1. [title](https://docs.nativescript.org/api/class/SegmentedBarItem#title) ## Pan Gesture Data [GestureEventDataWithState](https://docs.nativescript.org/api/interface/GestureEventDataWithState) PanGestureEventData ``` interface PanGestureEventData extends GestureEventDataWithState { deltaX: number; deltaY: number; } ``` Provides gesture event data for pan gesture. ## Summary [​](https://docs.nativescript.org/api/interface/PanGestureEventData\#summary) #### Properties [deltaX](https://docs.nativescript.org/api/interface/PanGestureEventData#deltax)[deltaY](https://docs.nativescript.org/api/interface/PanGestureEventData#deltay) 4 properties inherited from [GestureEventData](https://docs.nativescript.org/api/interface/GestureEventData) Click to expand [android](https://docs.nativescript.org/api/interface/GestureEventData#android)[ios](https://docs.nativescript.org/api/interface/GestureEventData#ios)[type](https://docs.nativescript.org/api/interface/GestureEventData#type)[view](https://docs.nativescript.org/api/interface/GestureEventData#view) 2 properties inherited from [EventData](https://docs.nativescript.org/api/interface/EventData) Click to expand [eventName](https://docs.nativescript.org/api/interface/EventData#eventname)[object](https://docs.nativescript.org/api/interface/EventData#object) 1 properties inherited from [GestureEventDataWithState](https://docs.nativescript.org/api/interface/GestureEventDataWithState) Click to expand [state](https://docs.nativescript.org/api/interface/GestureEventDataWithState#state) ## Properties [​](https://docs.nativescript.org/api/interface/PanGestureEventData\#properties) ### deltaX [​](https://docs.nativescript.org/api/interface/PanGestureEventData\#deltax) ``` deltaX: number ``` defined in [@nativescript/core/ui/gestures/index.d.ts:269:1](https://unpkg.com/browse/@nativescript/core//ui/gestures/index.d.ts#L269) ### deltaY [​](https://docs.nativescript.org/api/interface/PanGestureEventData\#deltay) ``` deltaY: number ``` defined in [@nativescript/core/ui/gestures/index.d.ts:270:1](https://unpkg.com/browse/@nativescript/core//ui/gestures/index.d.ts#L270) 2. [Summary](https://docs.nativescript.org/api/interface/PanGestureEventData#summary) 3. [Properties](https://docs.nativescript.org/api/interface/PanGestureEventData#properties) 1. [deltaX](https://docs.nativescript.org/api/interface/PanGestureEventData#deltax) 2. [deltaY](https://docs.nativescript.org/api/interface/PanGestureEventData#deltay) ## Android Directory Enum ## Summary [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#summary) #### Enumeration Members [ALARMS](https://docs.nativescript.org/api/enum/AndroidDirectory#alarms)[AUDIOBOOKS](https://docs.nativescript.org/api/enum/AndroidDirectory#audiobooks)[DCIM](https://docs.nativescript.org/api/enum/AndroidDirectory#dcim)[DOCUMENTS](https://docs.nativescript.org/api/enum/AndroidDirectory#documents)[DOWNLOADS](https://docs.nativescript.org/api/enum/AndroidDirectory#downloads)[MOVIES](https://docs.nativescript.org/api/enum/AndroidDirectory#movies)[MUSIC](https://docs.nativescript.org/api/enum/AndroidDirectory#music)[NOTIFICATIONS](https://docs.nativescript.org/api/enum/AndroidDirectory#notifications)[PICTURES](https://docs.nativescript.org/api/enum/AndroidDirectory#pictures)[PODCASTS](https://docs.nativescript.org/api/enum/AndroidDirectory#podcasts)[RINGTONES](https://docs.nativescript.org/api/enum/AndroidDirectory#ringtones)[SCREENSHOTS](https://docs.nativescript.org/api/enum/AndroidDirectory#screenshots) ## Enumeration Members [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#enumeration-members) ### ALARMS [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#alarms) ``` ALARMS: number ``` defined in [@nativescript/core/file-system/index.d.ts:4:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L4) ### AUDIOBOOKS [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#audiobooks) ``` AUDIOBOOKS: number ``` defined in [@nativescript/core/file-system/index.d.ts:5:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L5) ### DCIM [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#dcim) ``` DCIM: number ``` defined in [@nativescript/core/file-system/index.d.ts:6:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L6) ### DOCUMENTS [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#documents) ``` DOCUMENTS: number ``` defined in [@nativescript/core/file-system/index.d.ts:7:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L7) ### DOWNLOADS [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#downloads) ``` DOWNLOADS: number ``` defined in [@nativescript/core/file-system/index.d.ts:8:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L8) ### MOVIES [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#movies) ``` MOVIES: number ``` defined in [@nativescript/core/file-system/index.d.ts:9:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L9) ### MUSIC [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#music) ``` MUSIC: number ``` defined in [@nativescript/core/file-system/index.d.ts:10:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L10) ### NOTIFICATIONS [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#notifications) ``` NOTIFICATIONS: number ``` defined in [@nativescript/core/file-system/index.d.ts:11:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L11) ### PICTURES [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#pictures) ``` PICTURES: number ``` defined in [@nativescript/core/file-system/index.d.ts:12:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L12) ### PODCASTS [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#podcasts) ``` PODCASTS: number ``` defined in [@nativescript/core/file-system/index.d.ts:13:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L13) ### RINGTONES [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#ringtones) ``` RINGTONES: number ``` defined in [@nativescript/core/file-system/index.d.ts:14:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L14) ### SCREENSHOTS [​](https://docs.nativescript.org/api/enum/AndroidDirectory\#screenshots) ``` SCREENSHOTS: number ``` defined in [@nativescript/core/file-system/index.d.ts:15:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L15) 2. [Summary](https://docs.nativescript.org/api/enum/AndroidDirectory#summary) 3. [Enumeration Members](https://docs.nativescript.org/api/enum/AndroidDirectory#enumeration-members) 01. [ALARMS](https://docs.nativescript.org/api/enum/AndroidDirectory#alarms) 02. [AUDIOBOOKS](https://docs.nativescript.org/api/enum/AndroidDirectory#audiobooks) 03. [DCIM](https://docs.nativescript.org/api/enum/AndroidDirectory#dcim) 04. [DOCUMENTS](https://docs.nativescript.org/api/enum/AndroidDirectory#documents) 05. [DOWNLOADS](https://docs.nativescript.org/api/enum/AndroidDirectory#downloads) 06. [MOVIES](https://docs.nativescript.org/api/enum/AndroidDirectory#movies) 07. [MUSIC](https://docs.nativescript.org/api/enum/AndroidDirectory#music) 08. [NOTIFICATIONS](https://docs.nativescript.org/api/enum/AndroidDirectory#notifications) 09. [PICTURES](https://docs.nativescript.org/api/enum/AndroidDirectory#pictures) 10. [PODCASTS](https://docs.nativescript.org/api/enum/AndroidDirectory#podcasts) 11. [RINGTONES](https://docs.nativescript.org/api/enum/AndroidDirectory#ringtones) 12. [SCREENSHOTS](https://docs.nativescript.org/api/enum/AndroidDirectory#screenshots) ## Android Back Pressed Event [AndroidActivityEventData](https://docs.nativescript.org/api/interface/AndroidActivityEventData) AndroidActivityBackPressedEventData ``` interface AndroidActivityBackPressedEventData extends AndroidActivityEventData { cancel: boolean; } ``` Data for the Android activity back pressed event. ## Summary [​](https://docs.nativescript.org/api/interface/AndroidActivityBackPressedEventData\#summary) #### Properties [cancel](https://docs.nativescript.org/api/interface/AndroidActivityBackPressedEventData#cancel) 3 properties inherited from [AndroidActivityEventData](https://docs.nativescript.org/api/interface/AndroidActivityEventData) Click to expand [activity](https://docs.nativescript.org/api/interface/AndroidActivityEventData#activity)[eventName](https://docs.nativescript.org/api/interface/AndroidActivityEventData#eventname)[object](https://docs.nativescript.org/api/interface/AndroidActivityEventData#object) ## Properties [​](https://docs.nativescript.org/api/interface/AndroidActivityBackPressedEventData\#properties) ### cancel [​](https://docs.nativescript.org/api/interface/AndroidActivityBackPressedEventData\#cancel) ``` cancel: boolean ``` defined in [@nativescript/core/application/application-interfaces.d.ts:180:4](https://unpkg.com/browse/@nativescript/core//application/application-interfaces.d.ts#L180) In the event handler, set this value to true if you want to cancel the back navigation and do something else instead. 2. [Summary](https://docs.nativescript.org/api/interface/AndroidActivityBackPressedEventData#summary) 3. [Properties](https://docs.nativescript.org/api/interface/AndroidActivityBackPressedEventData#properties) 1. [cancel](https://docs.nativescript.org/api/interface/AndroidActivityBackPressedEventData#cancel) ## PageTransition Class Overview [Transition](https://docs.nativescript.org/api/class/Transition) PageTransition ## Summary [​](https://docs.nativescript.org/api/class/PageTransition\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/PageTransition#constructor) ## Constructors [​](https://docs.nativescript.org/api/class/PageTransition\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/PageTransition\#constructor) ``` new PageTransition(duration?: number, nativeCurve?: any): PageTransition ``` inherited from [constructor](https://docs.nativescript.org/api/class/Transition#constructor) defined in [@nativescript/core/ui/transition/index.d.ts:39:1](https://unpkg.com/browse/@nativescript/core//ui/transition/index.d.ts#L39) | | | | | --- | --- | --- | | Parameter | Default | Description | | `duration` | `` | `number` | | `nativeCurve` | `` | `any` | Returns _[PageTransition](https://docs.nativescript.org/api/class/PageTransition)_ 2. [Summary](https://docs.nativescript.org/api/class/PageTransition#summary) 3. [Constructors](https://docs.nativescript.org/api/class/PageTransition#constructors) 1. [constructor](https://docs.nativescript.org/api/class/PageTransition#constructor) ## Font Scale Categories ## Summary [​](https://docs.nativescript.org/api/enum/FontScaleCategory\#summary) #### Enumeration Members [ExtraLarge](https://docs.nativescript.org/api/enum/FontScaleCategory#extralarge)[ExtraSmall](https://docs.nativescript.org/api/enum/FontScaleCategory#extrasmall)[Medium](https://docs.nativescript.org/api/enum/FontScaleCategory#medium) ## Enumeration Members [​](https://docs.nativescript.org/api/enum/FontScaleCategory\#enumeration-members) ### ExtraLarge [​](https://docs.nativescript.org/api/enum/FontScaleCategory\#extralarge) ``` ExtraLarge: "extra-large" ``` defined in [@nativescript/core/accessibility/font-scale.d.ts:6:1](https://unpkg.com/browse/@nativescript/core//accessibility/font-scale.d.ts#L6) ### ExtraSmall [​](https://docs.nativescript.org/api/enum/FontScaleCategory\#extrasmall) ``` ExtraSmall: "extra-small" ``` defined in [@nativescript/core/accessibility/font-scale.d.ts:4:1](https://unpkg.com/browse/@nativescript/core//accessibility/font-scale.d.ts#L4) ### Medium [​](https://docs.nativescript.org/api/enum/FontScaleCategory\#medium) ``` Medium: "medium" ``` defined in [@nativescript/core/accessibility/font-scale.d.ts:5:1](https://unpkg.com/browse/@nativescript/core//accessibility/font-scale.d.ts#L5) 2. [Summary](https://docs.nativescript.org/api/enum/FontScaleCategory#summary) 3. [Enumeration Members](https://docs.nativescript.org/api/enum/FontScaleCategory#enumeration-members) 1. [ExtraLarge](https://docs.nativescript.org/api/enum/FontScaleCategory#extralarge) 2. [ExtraSmall](https://docs.nativescript.org/api/enum/FontScaleCategory#extrasmall) 3. [Medium](https://docs.nativescript.org/api/enum/FontScaleCategory#medium) ## File System Entity FileSystemEntity [File](https://docs.nativescript.org/api/class/File) [Folder](https://docs.nativescript.org/api/class/Folder) Represents a single entity on the file system. ## Summary [​](https://docs.nativescript.org/api/class/FileSystemEntity\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/FileSystemEntity#constructor) #### Properties [lastModified](https://docs.nativescript.org/api/class/FileSystemEntity#lastmodified)[name](https://docs.nativescript.org/api/class/FileSystemEntity#name)[parent](https://docs.nativescript.org/api/class/FileSystemEntity#parent)[path](https://docs.nativescript.org/api/class/FileSystemEntity#path) #### Methods [remove](https://docs.nativescript.org/api/class/FileSystemEntity#remove)[removeSync](https://docs.nativescript.org/api/class/FileSystemEntity#removesync)[rename](https://docs.nativescript.org/api/class/FileSystemEntity#rename)[renameSync](https://docs.nativescript.org/api/class/FileSystemEntity#renamesync) ## Constructors [​](https://docs.nativescript.org/api/class/FileSystemEntity\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/FileSystemEntity\#constructor) ``` new FileSystemEntity(): FileSystemEntity ``` Returns _[FileSystemEntity](https://docs.nativescript.org/api/class/FileSystemEntity)_ ## Properties [​](https://docs.nativescript.org/api/class/FileSystemEntity\#properties) ### lastModified [​](https://docs.nativescript.org/api/class/FileSystemEntity\#lastmodified) ``` lastModified: Date ``` defined in [@nativescript/core/file-system/index.d.ts:31:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L31) Gets the Date object specifying the last time this entity was modified. ### name [​](https://docs.nativescript.org/api/class/FileSystemEntity\#name) ``` name: string ``` defined in [@nativescript/core/file-system/index.d.ts:36:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L36) Gets the name of the entity. ### parent [​](https://docs.nativescript.org/api/class/FileSystemEntity\#parent) ``` parent: Folder ``` defined in [@nativescript/core/file-system/index.d.ts:48:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L48) Gets the Folder object representing the parent of this entity. Will be null for a root folder like Documents or Temporary. This property is readonly. ### path [​](https://docs.nativescript.org/api/class/FileSystemEntity\#path) ``` path: string ``` defined in [@nativescript/core/file-system/index.d.ts:41:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L41) Gets the fully-qualified path (including the extension for a File) of the entity. ## Methods [​](https://docs.nativescript.org/api/class/FileSystemEntity\#methods) ### remove [​](https://docs.nativescript.org/api/class/FileSystemEntity\#remove) ``` remove(): Promise<any> ``` defined in [@nativescript/core/file-system/index.d.ts:53:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L53) Removes (deletes) the current Entity from the file system. Returns _Promise_ ### removeSync [​](https://docs.nativescript.org/api/class/FileSystemEntity\#removesync) ``` removeSync(onError?: (error: any) => any): void ``` defined in [@nativescript/core/file-system/index.d.ts:58:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L58) Removes (deletes) the current Entity from the file system synchronously. | | | | | --- | --- | --- | | Parameter | Default | Description | | `onError` | `` | `(error: any) => any` | Returns _void_ ### rename [​](https://docs.nativescript.org/api/class/FileSystemEntity\#rename) ``` rename(newName: string): Promise<any> ``` defined in [@nativescript/core/file-system/index.d.ts:64:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L64) Renames the current entity using the specified name. | | | | | --- | --- | --- | | Parameter | Default | Description | | `newName` | `` | `string`
The new name to be applied to the entity. | Returns _Promise_ ### renameSync [​](https://docs.nativescript.org/api/class/FileSystemEntity\#renamesync) ``` renameSync(newName: string, onError?: (error: any) => any): void ``` defined in [@nativescript/core/file-system/index.d.ts:70:1](https://unpkg.com/browse/@nativescript/core//file-system/index.d.ts#L70) Renames the current entity synchronously, using the specified name. | | | | | --- | --- | --- | | Parameter | Default | Description | | `newName` | `` | `string`
The new name to be applied to the entity. | | `onError` | `` | `(error: any) => any` | Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/FileSystemEntity#summary) 3. [Constructors](https://docs.nativescript.org/api/class/FileSystemEntity#constructors) 1. [constructor](https://docs.nativescript.org/api/class/FileSystemEntity#constructor) 4. [Properties](https://docs.nativescript.org/api/class/FileSystemEntity#properties) 1. [lastModified](https://docs.nativescript.org/api/class/FileSystemEntity#lastmodified) 2. [name](https://docs.nativescript.org/api/class/FileSystemEntity#name) 3. [parent](https://docs.nativescript.org/api/class/FileSystemEntity#parent) 4. [path](https://docs.nativescript.org/api/class/FileSystemEntity#path) 5. [Methods](https://docs.nativescript.org/api/class/FileSystemEntity#methods) 1. [remove](https://docs.nativescript.org/api/class/FileSystemEntity#remove) 2. [removeSync](https://docs.nativescript.org/api/class/FileSystemEntity#removesync) 3. [rename](https://docs.nativescript.org/api/class/FileSystemEntity#rename) 4. [renameSync](https://docs.nativescript.org/api/class/FileSystemEntity#renamesync) ## Gesture Events Overview Events emitted during gesture lifecycle ## Summary [​](https://docs.nativescript.org/api/enum/GestureEvents\#summary) #### Enumeration Members [gestureAttached](https://docs.nativescript.org/api/enum/GestureEvents#gestureattached)[touchDown](https://docs.nativescript.org/api/enum/GestureEvents#touchdown)[touchUp](https://docs.nativescript.org/api/enum/GestureEvents#touchup) ## Enumeration Members [​](https://docs.nativescript.org/api/enum/GestureEvents\#enumeration-members) ### gestureAttached [​](https://docs.nativescript.org/api/enum/GestureEvents\#gestureattached) ``` gestureAttached: "gestureAttached" ``` defined in [@nativescript/core/ui/gestures/index.d.ts:14:1](https://unpkg.com/browse/@nativescript/core//ui/gestures/index.d.ts#L14) When the gesture is attached to the view Provides access to the native gesture recognizer for further customization ### touchDown [​](https://docs.nativescript.org/api/enum/GestureEvents\#touchdown) ``` touchDown: "touchDown" ``` defined in [@nativescript/core/ui/gestures/index.d.ts:18:1](https://unpkg.com/browse/@nativescript/core//ui/gestures/index.d.ts#L18) When a touch down was detected ### touchUp [​](https://docs.nativescript.org/api/enum/GestureEvents\#touchup) ``` touchUp: "touchUp" ``` defined in [@nativescript/core/ui/gestures/index.d.ts:22:1](https://unpkg.com/browse/@nativescript/core//ui/gestures/index.d.ts#L22) When a touch up was detected 2. [Summary](https://docs.nativescript.org/api/enum/GestureEvents#summary) 3. [Enumeration Members](https://docs.nativescript.org/api/enum/GestureEvents#enumeration-members) 1. [gestureAttached](https://docs.nativescript.org/api/enum/GestureEvents#gestureattached) 2. [touchDown](https://docs.nativescript.org/api/enum/GestureEvents#touchdown) 3. [touchUp](https://docs.nativescript.org/api/enum/GestureEvents#touchup) ## ChangeType Class Overview ChangeType ## Summary [​](https://docs.nativescript.org/api/class/ChangeType\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/ChangeType#constructor) #### Properties [Add](https://docs.nativescript.org/api/class/ChangeType#add)[Change](https://docs.nativescript.org/api/class/ChangeType#change)[Delete](https://docs.nativescript.org/api/class/ChangeType#delete)[Splice](https://docs.nativescript.org/api/class/ChangeType#splice)[Update](https://docs.nativescript.org/api/class/ChangeType#update) ## Constructors [​](https://docs.nativescript.org/api/class/ChangeType\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/ChangeType\#constructor) ``` new ChangeType(): ChangeType ``` Returns _[ChangeType](https://docs.nativescript.org/api/class/ChangeType)_ ## Properties [​](https://docs.nativescript.org/api/class/ChangeType\#properties) ### Add [​](https://docs.nativescript.org/api/class/ChangeType\#add) Static ``` Add: string ``` defined in [@nativescript/core/data/observable-array/index.d.ts:3:11](https://unpkg.com/browse/@nativescript/core//data/observable-array/index.d.ts#L3) ### Change [​](https://docs.nativescript.org/api/class/ChangeType\#change) Static ``` Change: string ``` defined in [@nativescript/core/data/observable-array/index.d.ts:7:11](https://unpkg.com/browse/@nativescript/core//data/observable-array/index.d.ts#L7) ### Delete [​](https://docs.nativescript.org/api/class/ChangeType\#delete) Static ``` Delete: string ``` defined in [@nativescript/core/data/observable-array/index.d.ts:4:11](https://unpkg.com/browse/@nativescript/core//data/observable-array/index.d.ts#L4) ### Splice [​](https://docs.nativescript.org/api/class/ChangeType\#splice) Static ``` Splice: string ``` defined in [@nativescript/core/data/observable-array/index.d.ts:6:11](https://unpkg.com/browse/@nativescript/core//data/observable-array/index.d.ts#L6) ### Update [​](https://docs.nativescript.org/api/class/ChangeType\#update) Static ``` Update: string ``` defined in [@nativescript/core/data/observable-array/index.d.ts:5:11](https://unpkg.com/browse/@nativescript/core//data/observable-array/index.d.ts#L5) 2. [Summary](https://docs.nativescript.org/api/class/ChangeType#summary) 3. [Constructors](https://docs.nativescript.org/api/class/ChangeType#constructors) 1. [constructor](https://docs.nativescript.org/api/class/ChangeType#constructor) 4. [Properties](https://docs.nativescript.org/api/class/ChangeType#properties) 1. [Add](https://docs.nativescript.org/api/class/ChangeType#add) 2. [Change](https://docs.nativescript.org/api/class/ChangeType#change) 3. [Delete](https://docs.nativescript.org/api/class/ChangeType#delete) 4. [Splice](https://docs.nativescript.org/api/class/ChangeType#splice) 5. [Update](https://docs.nativescript.org/api/class/ChangeType#update) ## Shared Transition Helper SharedTransitionHelper Platform helper to aid in creating your own custom Shared Element Transition classes. (iOS Only) ## Summary [​](https://docs.nativescript.org/api/class/SharedTransitionHelper\#summary) #### Constructors [constructor](https://docs.nativescript.org/api/class/SharedTransitionHelper#constructor) #### Methods [animate](https://docs.nativescript.org/api/class/SharedTransitionHelper#animate)[interactiveCancel](https://docs.nativescript.org/api/class/SharedTransitionHelper#interactivecancel)[interactiveFinish](https://docs.nativescript.org/api/class/SharedTransitionHelper#interactivefinish)[interactiveStart](https://docs.nativescript.org/api/class/SharedTransitionHelper#interactivestart)[interactiveUpdate](https://docs.nativescript.org/api/class/SharedTransitionHelper#interactiveupdate) ## Constructors [​](https://docs.nativescript.org/api/class/SharedTransitionHelper\#constructors) ### constructor [​](https://docs.nativescript.org/api/class/SharedTransitionHelper\#constructor) ``` new SharedTransitionHelper(): SharedTransitionHelper ``` Returns _[SharedTransitionHelper](https://docs.nativescript.org/api/class/SharedTransitionHelper)_ ## Methods [​](https://docs.nativescript.org/api/class/SharedTransitionHelper\#methods) ### animate [​](https://docs.nativescript.org/api/class/SharedTransitionHelper\#animate) Static ``` animate( state: SharedTransitionState, transitionContext: any, type: TransitionNavigationType ): void ``` defined in [@nativescript/core/ui/transition/shared-transition-helper.d.ts:9:1](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition-helper.d.ts#L9) | | | | | --- | --- | --- | | Parameter | Default | Description | | `state` | `` | `SharedTransitionState` | | `transitionContext` | `` | `any` | | `type` | `` | `TransitionNavigationType` | Returns _void_ ### interactiveCancel [​](https://docs.nativescript.org/api/class/SharedTransitionHelper\#interactivecancel) Static ``` interactiveCancel( state: SharedTransitionState, interactiveState: TransitionInteractiveState, type: TransitionNavigationType ): void ``` defined in [@nativescript/core/ui/transition/shared-transition-helper.d.ts:12:1](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition-helper.d.ts#L12) | | | | | --- | --- | --- | | Parameter | Default | Description | | `state` | `` | `SharedTransitionState` | | `interactiveState` | `` | `TransitionInteractiveState` | | `type` | `` | `TransitionNavigationType` | Returns _void_ ### interactiveFinish [​](https://docs.nativescript.org/api/class/SharedTransitionHelper\#interactivefinish) Static ``` interactiveFinish( state: SharedTransitionState, interactiveState: TransitionInteractiveState, type: TransitionNavigationType ): void ``` defined in [@nativescript/core/ui/transition/shared-transition-helper.d.ts:13:1](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition-helper.d.ts#L13) | | | | | --- | --- | --- | | Parameter | Default | Description | | `state` | `` | `SharedTransitionState` | | `interactiveState` | `` | `TransitionInteractiveState` | | `type` | `` | `TransitionNavigationType` | Returns _void_ ### interactiveStart [​](https://docs.nativescript.org/api/class/SharedTransitionHelper\#interactivestart) Static ``` interactiveStart( state: SharedTransitionState, interactiveState: TransitionInteractiveState, type: TransitionNavigationType ): void ``` defined in [@nativescript/core/ui/transition/shared-transition-helper.d.ts:10:1](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition-helper.d.ts#L10) | | | | | --- | --- | --- | | Parameter | Default | Description | | `state` | `` | `SharedTransitionState` | | `interactiveState` | `` | `TransitionInteractiveState` | | `type` | `` | `TransitionNavigationType` | Returns _void_ ### interactiveUpdate [​](https://docs.nativescript.org/api/class/SharedTransitionHelper\#interactiveupdate) Static ``` interactiveUpdate( state: SharedTransitionState, interactiveState: TransitionInteractiveState, type: TransitionNavigationType, percent: number ): void ``` defined in [@nativescript/core/ui/transition/shared-transition-helper.d.ts:11:1](https://unpkg.com/browse/@nativescript/core//ui/transition/shared-transition-helper.d.ts#L11) | | | | | --- | --- | --- | | Parameter | Default | Description | | `state` | `` | `SharedTransitionState` | | `interactiveState` | `` | `TransitionInteractiveState` | | `type` | `` | `TransitionNavigationType` | | `percent` | `` | `number` | Returns _void_ 2. [Summary](https://docs.nativescript.org/api/class/SharedTransitionHelper#summary) 3. [Constructors](https://docs.nativescript.org/api/class/SharedTransitionHelper#constructors) 1. [constructor](https://docs.nativescript.org/api/class/SharedTransitionHelper#constructor) 4. [Methods](https://docs.nativescript.org/api/class/SharedTransitionHelper#methods) 1. [animate](https://docs.nativescript.org/api/class/SharedTransitionHelper#animate) 2. [interactiveCancel](https://docs.nativescript.org/api/class/SharedTransitionHelper#interactivecancel) 3. [interactiveFinish](https://docs.nativescript.org/api/class/SharedTransitionHelper#interactivefinish) 4. [interactiveStart](https://docs.nativescript.org/api/class/SharedTransitionHelper#interactivestart) 5. [interactiveUpdate](https://docs.nativescript.org/api/class/SharedTransitionHelper#interactiveupdate) ## Download Error Interface [EventData](https://docs.nativescript.org/api/interface/EventData) DownloadError ``` interface DownloadError extends EventData { error: Error; key: string; } ``` Provides data for download error. ## Summary [​](https://docs.nativescript.org/api/interface/DownloadError\#summary) #### Properties [error](https://docs.nativescript.org/api/interface/DownloadError#error)[key](https://docs.nativescript.org/api/interface/DownloadError#key) 2 properties inherited from [EventData](https://docs.nativescript.org/api/interface/EventData) Click to expand [eventName](https://docs.nativescript.org/api/interface/EventData#eventname)[object](https://docs.nativescript.org/api/interface/EventData#object) ## Properties [​](https://docs.nativescript.org/api/interface/DownloadError\#properties) ### error [​](https://docs.nativescript.org/api/interface/DownloadError\#error) ``` error: Error ``` defined in [@nativescript/core/ui/image-cache/index.d.ts:142:1](https://unpkg.com/browse/@nativescript/core//ui/image-cache/index.d.ts#L142) Gets the error. ### key [​](https://docs.nativescript.org/api/interface/DownloadError\#key) ``` key: string ``` defined in [@nativescript/core/ui/image-cache/index.d.ts:138:1](https://unpkg.com/browse/@nativescript/core//ui/image-cache/index.d.ts#L138) A string indentifier of the cached image. 2. [Summary](https://docs.nativescript.org/api/interface/DownloadError#summary) 3. [Properties](https://docs.nativescript.org/api/interface/DownloadError#properties) 1. [error](https://docs.nativescript.org/api/interface/DownloadError#error) 2. [key](https://docs.nativescript.org/api/interface/DownloadError#key)