Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Frame

Represents the logical View unit that is responsible for navigation within an application. Nested frames are supported, enabling hierarchical navigation scenarios.

Hierarchy

  • FrameBase

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Optional _androidContentDescriptionUpdated

_androidContentDescriptionUpdated: boolean

Internal use only. This is used to limit the number of updates to android.view.View.setContentDescription()

Private _animationInProgress

_animationInProgress: boolean

_automaticallyAdjustsScrollViewInsets

_automaticallyAdjustsScrollViewInsets: boolean

_context

_context: any

_cssState

_cssState: CssState

Private _currentEntry

_currentEntry: BackstackEntry

Private _currentHeightMeasureSpec

_currentHeightMeasureSpec: number

Private _currentWidthMeasureSpec

_currentWidthMeasureSpec: number

_defaultPaddingBottom

_defaultPaddingBottom: number

_defaultPaddingLeft

_defaultPaddingLeft: number

_defaultPaddingRight

_defaultPaddingRight: number

_defaultPaddingTop

_defaultPaddingTop: number

_domId

_domId: number

Private _executingContext

_executingContext: NavigationContext

Private _gestureObservers

_gestureObservers: any

_ignoreFlexMinWidthHeightReset

_ignoreFlexMinWidthHeightReset: boolean

_isAddedToNativeVisualTree

_isAddedToNativeVisualTree: boolean

_isInFrameStack

_isInFrameStack: boolean

_isPaddingRelative

_isPaddingRelative: boolean

_isStyleScopeHost

_isStyleScopeHost: boolean

_isViewBase

_isViewBase: boolean

Private _manager

_manager: any

Optional Private _modalParent

_modalParent: View

_moduleName

_moduleName: string

_oldBottom

_oldBottom: number

_oldLeft

_oldLeft: number

_oldRight

_oldRight: number

_oldTop

_oldTop: number

_styleScope

_styleScope: StyleScope

_suspendNativeUpdatesCount

_suspendNativeUpdatesCount: number

_suspendedUpdates

_suspendedUpdates: object

Type declaration

accessibilityHidden

accessibilityHidden: boolean

Hide the view and its children from the a11y service

accessibilityHint

accessibilityHint: string

A hint describes the elements behavior. Example: 'Tap change playback speed'

accessibilityIdentifier

accessibilityIdentifier: string

The view's unique accessibilityIdentifier.

This is used for automated testing.

accessibilityLabel

accessibilityLabel: string

Short description of the element, ideally one word.

accessibilityLanguage

accessibilityLanguage: string

Sets the language in which to speak the element's label and value. Accepts language ID tags that follows the "BCP 47" specification.

accessibilityLiveRegion

accessibilityLiveRegion: AccessibilityLiveRegion

accessibilityMediaSession

accessibilityMediaSession: boolean

This view starts a media session. Equivalent to trait = startsMedia

accessibilityRole

accessibilityRole: AccessibilityRole

Which role should this view be treated by the a11y service?

accessibilityState

accessibilityState: AccessibilityState

Which state should this view be treated as by the a11y service?

accessibilityValue

accessibilityValue: string

Current value of the element in a localized string.

accessible

accessible: boolean

If true the element is an accessibility element and all the children will be treated as a single selectable component.

actionBarVisibility

actionBarVisibility: "auto" | "always" | "never"

Used to control the visibility the Navigation Bar in iOS and the Action Bar in Android.

alignSelf

alignSelf: AlignSelf

android

android: AndroidFrame

Gets the AndroidFrame object that represents the Android-specific APIs for this Frame. Valid when running on Android OS.

androidDynamicElevationOffset

androidDynamicElevationOffset: number

Gets or sets the dynamic elevation offset of the android view.

androidElevation

androidElevation: number

Gets or sets the elevation of the android view.

animated

animated: boolean

Gets or sets if navigation transitions should be animated.

automationText

automationText: string

backStack

backStack: BackstackEntry[]

Gets the back stack of this instance.

background

background: string

Gets or sets the background style property.

backgroundColor

backgroundColor: string | Color

Gets or sets the background color of the view.

backgroundImage

backgroundImage: string | LinearGradient

Gets or sets the background image of the view.

bindingContext

bindingContext: any

Gets or sets the binding context of this instance. This object is used as a source for each Binding that does not have a source object specified.

borderBottomColor

borderBottomColor: Color

Gets or sets the bottom border color of the view.

borderBottomLeftRadius

borderBottomLeftRadius: LengthType

Gets or sets the bottom left border radius of the view.

borderBottomRightRadius

borderBottomRightRadius: LengthType

Gets or sets the bottom right border radius of the view.

borderBottomWidth

borderBottomWidth: LengthType

Gets or sets the bottom border width of the view.

borderColor

borderColor: string | Color

Gets or sets the border color of the view.

borderLeftColor

borderLeftColor: Color

Gets or sets the left border color of the view.

borderLeftWidth

borderLeftWidth: LengthType

Gets or sets the left border width of the view.

borderRadius

borderRadius: string | number | LengthDipUnit | LengthPxUnit

Gets or sets the border radius of the view.

borderRightColor

borderRightColor: Color

Gets or sets the right border color of the view.

borderRightWidth

borderRightWidth: LengthType

Gets or sets the right border width of the view.

borderTopColor

borderTopColor: Color

Gets or sets the top border color of the view.

borderTopLeftRadius

borderTopLeftRadius: LengthType

Gets or sets the top left border radius of the view.

borderTopRightRadius

borderTopRightRadius: LengthType

Gets or sets the top right border radius of the view.

borderTopWidth

borderTopWidth: LengthType

Gets or sets the top border width of the view.

borderWidth

borderWidth: string | number | LengthDipUnit | LengthPxUnit

Gets or sets the border width of the view.

boxShadow

boxShadow: string | CSSShadow

Gets or sets the box shadow of the view.

className

className: string

col

col: number

colSpan

colSpan: number

color

color: Color

Gets or sets the color of the view.

column

column: number

columnSpan

columnSpan: number

Private css

css: string

cssClasses

cssClasses: Set<string>

cssPseudoClasses

cssPseudoClasses: Set<string>

cssType

cssType: string

Gets the CSS fully qualified type name. Using this as element type should allow for PascalCase and kebap-case selectors, when fully qualified, to match the element.

currentEntry

currentEntry: NavigationEntry

Gets the NavigationEntry instance the Frame is currently navigated to.

currentPage

currentPage: Page

Gets the Page instance the Frame is currently navigated to.

dock

dock: DockType

domNode

domNode: DOMNode

effectiveBorderBottomWidth

effectiveBorderBottomWidth: number

effectiveBorderLeftWidth

effectiveBorderLeftWidth: number

effectiveBorderRightWidth

effectiveBorderRightWidth: number

effectiveBorderTopWidth

effectiveBorderTopWidth: number

effectiveHeight

effectiveHeight: number

effectiveLeft

effectiveLeft: number

effectiveMarginBottom

effectiveMarginBottom: number

effectiveMarginLeft

effectiveMarginLeft: number

effectiveMarginRight

effectiveMarginRight: number

effectiveMarginTop

effectiveMarginTop: number

effectiveMinHeight

effectiveMinHeight: number

effectiveMinWidth

effectiveMinWidth: number

effectivePaddingBottom

effectivePaddingBottom: number

effectivePaddingLeft

effectivePaddingLeft: number

effectivePaddingRight

effectivePaddingRight: number

effectivePaddingTop

effectivePaddingTop: number

effectiveTop

effectiveTop: number

effectiveWidth

effectiveWidth: number

flexGrow

flexGrow: number

flexShrink

flexShrink: number

flexWrapBefore

flexWrapBefore: boolean

height

Gets or sets the desired height of the view.

horizontalAlignment

horizontalAlignment: HorizontalAlignmentType

Gets or sets the alignment of this view within its parent along the Horizontal axis.

id

id: string

ios

ios: iOSFrame

Gets the iOSFrame object that represents the iOS-specific APIs for this Frame. Valid when running on iOS.

iosIgnoreSafeArea

iosIgnoreSafeArea: boolean

Gets or sets a value indicating whether the the view should totally ignore safe areas computation. This property is iOS specific. Default value: false

iosOverflowSafeArea

iosOverflowSafeArea: boolean

Instruct container view to expand beyond the safe area. This property is iOS specific. Default value: true

iosOverflowSafeAreaEnabled

iosOverflowSafeAreaEnabled: boolean

Enables or disables the iosOverflowSafeArea property for all children. This property is iOS specific. Default value: true

isCollapsed

isCollapsed: any

isEnabled

isEnabled: boolean

Gets or sets a value indicating whether the the view is enabled. This affects the appearance of the view.

Private isLayoutRequired

isLayoutRequired: boolean

isLayoutValid

isLayoutValid: boolean

Gets is layout is valid. This is a read-only property.

isUserInteractionEnabled

isUserInteractionEnabled: boolean

Gets or sets a value indicating whether the user can interact with the view. This does not affect the appearance of the view.

left

margin

margin: string | number | LengthDipUnit | LengthPxUnit | LengthPercentUnit

Gets or sets margin style property.

marginBottom

marginBottom: PercentLengthType

Specifies extra space on the bottom side of this view.

marginLeft

marginLeft: PercentLengthType

Specifies extra space on the left side of this view.

marginRight

marginRight: PercentLengthType

Specifies extra space on the right side of this view.

marginTop

Specifies extra space on the top side of this view.

minHeight

minHeight: LengthType

Gets or sets the minimum height the view may grow to.

minWidth

minWidth: LengthType

Gets or sets the minimum width the view may grow to.

modal

modal: View

Returns the current modal view that this page is showing (is parent of), if any.

nativeViewProtected

nativeViewProtected: any

Private navigationBarHeight

navigationBarHeight: number

opacity

opacity: number

Gets or sets the opacity style property.

order

order: number

originX

originX: number

Gets or sets the X component of the origin point around which the view will be transformed. The default value is 0.5 representing the center of the view.

originY

originY: number

Gets or sets the Y component of the origin point around which the view will be transformed. The default value is 0.5 representing the center of the view.

parent

parent: ViewBase

perspective

perspective: number

Gets or sets the distance of the camera form the view perspective. Usually needed when rotating the view over the X or Y axis.

recycleNativeView

recycleNativeView: "auto" | "always" | "never"

reusable

reusable: boolean

rotate

rotate: number

Gets or sets the rotate affine transform of the view along the Z axis.

rotateX

rotateX: number

Gets or sets the rotate affine transform of the view along the X axis.

rotateY

rotateY: number

Gets or sets the rotate affine transform of the view along the Y axis.

row

row: number

rowSpan

rowSpan: number

scaleX

scaleX: number

Gets or sets the scaleX affine transform of the view.

scaleY

scaleY: number

Gets or sets the scaleY affine transform of the view.

top

transition

Gets or sets the default navigation transition for this frame.

translateX

translateX: number

Gets or sets the translateX affine transform of the view in device independent pixels.

translateY

translateY: number

Gets or sets the translateY affine transform of the view in device independent pixels.

verticalAlignment

verticalAlignment: VerticalAlignmentType

Gets or sets the alignment of this view within its parent along the Vertical axis.

viewController

viewController: any

visibility

visibility: VisibilityType

Gets or sets the visibility of the view.

width

Gets or sets the desired width of the view.

Static accessibilityBlurEvent

accessibilityBlurEvent: string

String value used when hooking to accessibilityBlur event.

Static accessibilityFocusChangedEvent

accessibilityFocusChangedEvent: string

String value used when hooking to accessibilityFocusChanged event.

Static accessibilityFocusEvent

accessibilityFocusEvent: string

String value used when hooking to accessibilityFocus event.

Static androidOptionSelectedEvent

androidOptionSelectedEvent: string

Static createdEvent

createdEvent: string

Static defaultAnimatedNavigation

defaultAnimatedNavigation: boolean

Gets or sets if navigation transitions should be animated globally.

Static defaultTransition

defaultTransition: NavigationTransition

Gets or sets the default NavigationTransition for all frames across the app.

Static layoutChangedEvent

layoutChangedEvent: string

String value used when hooking to layoutChanged event.

Static loadedEvent

loadedEvent: string

Static propertyChangeEvent

propertyChangeEvent: string

Static showingModallyEvent

showingModallyEvent: string

String value used when hooking to showingModally event.

Static shownModallyEvent

shownModallyEvent: string

String value used when hooking to shownModally event.

Static unloadedEvent

unloadedEvent: string

Accessors

_childrenCount

  • get (): number

class

  • get (): string
  • set (v: string): void

isLoaded

  • get (): boolean

nativeView

  • get (): any
  • set (value: any): void

page

parentNode

style

typeName

  • get (): string

Methods

_addChildFromBuilder

  • _addChildFromBuilder(name: string, value: any): void

_addView

  • _addView(view: ViewBase, atIndex?: number): void

_addViewCore

  • _addViewCore(view: ViewBase, atIndex?: number): void

_addViewToNativeVisualTree

  • _addViewToNativeVisualTree(child: View): boolean

_applyXmlAttribute

  • _applyXmlAttribute(attribute: string, value: string): boolean
  • deprecated

    This used to be the way to set attribute values in early {N} versions. Now attributes are expected to be set as plain properties on the view instances.

    Parameters

    • attribute: string
    • value: string

    Returns boolean

_backstackEntryTrace

  • _backstackEntryTrace(b: BackstackEntry): string

_batchUpdate

  • _batchUpdate<T>(callback: function): T
  • Type parameters

    • T

    Parameters

    • callback: function
        • (): T
        • Returns T

    Returns T

_childIndexToNativeChildIndex

  • _childIndexToNativeChildIndex(index?: number): number

_closeAllModalViewsInternal

  • _closeAllModalViewsInternal(): boolean
  • Internal method: Closes all modal views. Should be used by plugins like nativescript-angular which implement their own modal views service.

    Returns boolean

_createPropertyChangeData

  • _createPropertyChangeData(propertyName: string, value: any, oldValue?: any): PropertyChangeData

_dialogClosed

  • _dialogClosed(): void

_eachLayoutView

  • _eachLayoutView(callback: function): void
  • Parameters

    • callback: function
        • (View: any): void
        • Parameters

          • View: any

          Returns void

    Returns void

_emit

  • _emit(eventNames: string): void

Private _findEntryForTag

Private _getCurrentLayoutBounds

  • _getCurrentLayoutBounds(): object
  • Return view bounds.

    Returns object

    • bottom: number
    • left: number
    • right: number
    • top: number

Private _getFragmentManager

  • _getFragmentManager(): any

Private _getIsAnimatedNavigation

_getNativeViewsCount

  • _getNativeViewsCount(): number

Private _getNavBarVisible

  • _getNavBarVisible(page: Page): boolean

Private _getNavigationTransition

_getRootModalViews

  • _getRootModalViews(): ViewBase[]
  • Internal method: Gets all modal views of the current view.

    Returns ViewBase[]

_getValue

  • _getValue(property: any): never
  • Obsolete: There is a new property system that does not rely on _getValue.

    Parameters

    • property: any

    Returns never

_goBackCore

  • _goBackCore(backstackEntry: BackstackEntry): void

Private _goToVisualState

  • _goToVisualState(state: string): any

_handleLivesync

  • _handleLivesync(context?: ModuleContext): boolean
  • Parameters

    • Optional context: ModuleContext

    Returns boolean

_hasAncestorView

  • _hasAncestorView(ancestorView: View): boolean
  • Checks whether the current view has specific view for an ancestor.

    Parameters

    • ancestorView: View

    Returns boolean

_inheritStyleScope

  • _inheritStyleScope(styleScope: StyleScope): void

_layoutParent

  • _layoutParent(): void

_navigateCore

  • _navigateCore(backstackEntry: BackstackEntry): void

_onAttachedToWindow

  • _onAttachedToWindow(): void
  • Called in android when native view is attached to window.

    Returns void

_onCssStateChange

  • _onCssStateChange(): void

_onDetachedFromWindow

  • _onDetachedFromWindow(): void
  • Called in android when native view is dettached from window.

    Returns void

_onLivesync

  • _onLivesync(context?: ModuleContext): boolean

_onNavigatingTo

  • _onNavigatingTo(backstackEntry: BackstackEntry, isBack: boolean): void
  • Parameters

    • backstackEntry: BackstackEntry
    • isBack: boolean

    Returns void

_onRootViewReset

  • _onRootViewReset(): void

Optional _onSizeChanged

  • _onSizeChanged(): void
  • iOS Only Internal method used to update various view details like background rerendering, border, etc.

    Returns void

_parentChanged

  • _parentChanged(oldParent: ViewBase): void

_popFromFrameStack

  • _popFromFrameStack(): void

_printFrameBackStack

  • _printFrameBackStack(): void

Private _processNavigationQueue

  • _processNavigationQueue(page: Page): any

Protected _processNextNavigationEntry

  • _processNextNavigationEntry(): void

Private _pushInFrameStack

  • _pushInFrameStack(): any

Private _pushInFrameStackRecursive

  • _pushInFrameStackRecursive(): any

Private _redrawNativeBackground

  • _redrawNativeBackground(value: any): void

Private _removeAnimation

  • _removeAnimation(animation: Animation): boolean

_removeEntry

  • _removeEntry(removed: BackstackEntry): void

Private _removeFromFrameStack

  • _removeFromFrameStack(): any

_removeView

  • Core logic for removing a child view from this instance. Used by the framework to handle lifecycle events more centralized. Do not use outside the UI Stack implementation.

    Parameters

    Returns void

_removeViewCore

  • Method is intended to be overridden by inheritors and used as "protected"

    Parameters

    Returns void

_removeViewFromNativeVisualTree

  • _removeViewFromNativeVisualTree(child: View): void

_resumeNativeUpdates

  • _resumeNativeUpdates(type: SuspendType): void

Private _setChildMinHeightNative

Private _setChildMinWidthNative

Private _setCurrentLayoutBounds

  • _setCurrentLayoutBounds(left: number, top: number, right: number, bottom: number): object
  • Called by layout method to cache view bounds.

    Parameters

    • left: number
    • top: number
    • right: number
    • bottom: number

    Returns object

    • boundsChanged: boolean
    • sizeChanged: boolean

Private _setCurrentMeasureSpecs

  • _setCurrentMeasureSpecs(widthMeasureSpec: number, heightMeasureSpec: number): boolean
  • Called by measure method to cache measureSpecs.

    Parameters

    • widthMeasureSpec: number
    • heightMeasureSpec: number

    Returns boolean

Private _setMinHeightNative

Private _setMinWidthNative

Private _setNativeClipToBounds

  • _setNativeClipToBounds(): void

Private _setNativeViewFrame

  • _setNativeViewFrame(nativeView: any, frame: any): void
  • Parameters

    • nativeView: any
    • frame: any

    Returns void

_setValue

  • _setValue(property: any, value: any): never
  • Obsolete: There is a new property system that does not rely on _setValue.

    Parameters

    • property: any
    • value: any

    Returns never

_setupAsRootView

  • _setupAsRootView(context: any): void

_setupUI

  • _setupUI(context: any, atIndex?: number, parentIsLoaded?: boolean): void
  • Parameters

    • context: any
    • Optional atIndex: number
    • Optional parentIsLoaded: boolean

    Returns void

_shouldDelayLayout

  • _shouldDelayLayout(): boolean

_suspendNativeUpdates

  • _suspendNativeUpdates(type: SuspendType): void

_tearDownUI

  • _tearDownUI(force?: boolean): void

Private _updateActionBar

  • _updateActionBar(page?: Page, disableNavBarAnimation?: boolean): any
  • Parameters

    • Optional page: Page
    • Optional disableNavBarAnimation: boolean

    Returns any

Private _updateBackstack

  • _updateBackstack(entry: BackstackEntry, navigationType: NavigationType): void

Private _updateEffectiveLayoutValues

  • _updateEffectiveLayoutValues(parentWidthMeasureSize: number, parentWidthMeasureMode: number, parentHeightMeasureSize: number, parentHeightMeasureMode: number): void
  • Parameters

    • parentWidthMeasureSize: number
    • parentWidthMeasureMode: number
    • parentHeightMeasureSize: number
    • parentHeightMeasureMode: number

    Returns void

Private _updateNativeLayoutParams

  • _updateNativeLayoutParams(child: View): void

_updateStyleScope

  • _updateStyleScope(cssFileName?: string, cssString?: string, css?: string): void
  • Updates styleScope or create new styleScope.

    Parameters

    • Optional cssFileName: string
    • Optional cssString: string
    • Optional css: string

    Returns void

accessibilityAnnouncement

  • accessibilityAnnouncement(msg?: string): void
  • Make an announcement to the screen reader.

    Parameters

    • Optional msg: string

    Returns void

accessibilityScreenChanged

  • accessibilityScreenChanged(): void

Private addCss

  • addCss(cssString: string): void
  • Parameters

    • cssString: string

      A valid css which will be added to current css.

    Returns void

Private addCssFile

  • addCssFile(cssFileName: string): void
  • Parameters

    • cssFileName: string

      A valid file name (from the application root) which contains a valid css.

    Returns void

addEventListener

  • addEventListener(eventNames: string, callback: function, thisArg?: any): void
  • Parameters

    • eventNames: string
    • callback: function
    • Optional thisArg: any

    Returns void

addPseudoClass

  • addPseudoClass(name: string): void

animate

bind

callLoaded

  • callLoaded(): void

callUnloaded

  • callUnloaded(): void

canGoBack

  • canGoBack(): boolean
  • Checks whether the goBack operation is available.

    Returns boolean

Private changeCssFile

  • changeCssFile(cssFileName: string): void
  • Parameters

    • cssFileName: string

      A valid file name (from the application root) which contains a valid css.

    Returns void

closeModal

  • closeModal(...args: any[]): void

createAnimation

createNativeView

  • createNativeView(): Object

deletePseudoClass

  • deletePseudoClass(name: string): void

destroyNode

  • destroyNode(forceDestroyChildren?: boolean): void

disposeNativeView

  • disposeNativeView(): void

eachChild

  • eachChild(callback: function): void

eachChildView

  • eachChildView(callback: function): void
  • Parameters

    • callback: function
        • (child: View): boolean
        • Parameters

          Returns boolean

    Returns void

ensureDomNode

  • ensureDomNode(): void

focus

  • focus(): boolean
  • Tries to focus the view. Returns a value indicating whether this view or one of its descendants actually took focus.

    Returns boolean

get

  • get(name: string): any

getActualSize

  • getActualSize(): Size
  • Returns the actual size of the view in device-independent pixels.

    Returns Size

getGestureObservers

  • getGestureObservers(type: GestureTypes): GesturesObserver[]

getLocationInWindow

  • getLocationInWindow(): Point
  • Returns the location of this view in the window coordinate system.

    Returns Point

getLocationOnScreen

  • getLocationOnScreen(): Point
  • Returns the location of this view in the screen coordinate system.

    Returns Point

getLocationRelativeTo

  • getLocationRelativeTo(otherView: View): Point
  • Returns the location of this view in the otherView's coordinate system.

    Parameters

    Returns Point

getMeasuredHeight

  • getMeasuredHeight(): number

getMeasuredState

  • getMeasuredState(): number

getMeasuredWidth

  • getMeasuredWidth(): number

getSafeAreaInsets

  • getSafeAreaInsets(): object
  • Returns the iOS safe area insets of this view.

    Returns object

    • bottom: any
    • left: any
    • right: any
    • top: any

getViewByDomId

  • getViewByDomId<T>(domId: number): T

getViewById

  • getViewById<T>(id: string): T

goBack

  • Navigates to the previous entry (if any) in the back stack.

    Parameters

    • Optional to: BackstackEntry

      The backstack entry to navigate back to.

    Returns any

Optional hasGestureObservers

  • hasGestureObservers(): boolean
  • Android only check if gesture observers are attached

    Returns boolean

hasListeners

  • hasListeners(eventName: string): boolean

initNativeView

  • initNativeView(): void

Private isCurrent

layout

  • layout(left: number, top: number, right: number, bottom: number, setFrame?: boolean): void
  • Assign a size and position to a view and all of its descendants This is the second phase of the layout mechanism. (The first is measuring). In this phase, each parent calls layout on all of its children to position them. This is typically done using the child measurements that were stored in the measure pass(). Derived classes should not override this method. Derived classes with children should override onLayout. In that method, they should call layout on each of their children.

    Parameters

    • left: number
    • top: number
    • right: number
    • bottom: number
    • Optional setFrame: boolean

    Returns void

layoutNativeView

  • layoutNativeView(left: number, top: number, right: number, bottom: number): void
  • Called from onLayout when native view position is about to be changed.

    Parameters

    • left: number

      Left position, relative to parent

    • top: number

      Top position, relative to parent

    • right: number

      Right position, relative to parent

    • bottom: number

      Bottom position, relative to parent

    Returns void

loadView

measure

  • measure(widthMeasureSpec: number, heightMeasureSpec: number): void
  • This is called to find out how big a view should be. The parent supplies constraint information in the width and height parameters. The actual measurement work of a view is performed in onMeasure(int, int), called by this method. Therefore, only onMeasure(int, int) can and must be overridden by subclasses.

    Parameters

    • widthMeasureSpec: number

      Horizontal space requirements as imposed by the parent

    • heightMeasureSpec: number

      Vertical space requirements as imposed by the parent

    Returns void

navigate

  • navigate(pageModuleName: string): any
  • navigate(create: function): any
  • navigate(entry: NavigationEntry): any
  • Navigates to a Page instance as described by the module name. This method will require the module and will check for a Page property in the exports of the module.

    Parameters

    • pageModuleName: string

      The name of the module to require starting from the application root. For example if you want to navigate to page called "myPage.js" in a folder called "subFolder" and your root folder is "app" you can call navigate method like this: const frames = require("@nativescript/core/ui/frame"); frames.topmost().navigate("app/subFolder/myPage");

    Returns any

  • Creates a new Page instance using the provided callback and navigates to that Page.

    Parameters

    • create: function

      The function to be used to create the new Page instance.

    Returns any

  • Navigates to a Page resolved by the provided NavigationEntry object. Since there are a couple of ways to specify a Page instance through an entry, there is a resolution priority: 1. entry.moduleName 2. entry.create()

    Parameters

    Returns any

Private navigationQueueIsEmpty

  • navigationQueueIsEmpty(): boolean

notify

  • notify<T>(data: T): void

notifyPropertyChange

  • notifyPropertyChange(name: string, value: any, oldValue?: any): void
  • Parameters

    • name: string
    • value: any
    • Optional oldValue: any

    Returns void

off

  • off(eventNames: string | GestureTypes, callback?: function, thisArg?: any): any
  • Removes listener(s) for the specified event name.

    Parameters

    • eventNames: string | GestureTypes

      Comma delimited names of the events or gesture types the specified listener is associated with.

    • Optional callback: function

      An optional parameter pointing to a specific listener. If not defined, all listeners for the event names will be removed.

    • Optional 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 any

on

  • on(eventNames: string, callback: function, thisArg?: any): any
  • on(event: "navigatingTo", callback: function, thisArg?: any): any
  • on(event: "navigatedTo", callback: function, thisArg?: any): any
  • A basic method signature to hook an event listener (shortcut alias to the addEventListener method).

    Parameters

    • eventNames: string

      String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by , (e.g. "propertyChange", "change").

    • callback: function

      Callback function which will be executed when event is raised.

    • Optional thisArg: any

      An optional parameter which will be used as this context for callback execution.

    Returns any

  • Raised when navigation to the page has started.

    Parameters

    • event: "navigatingTo"
    • callback: function
        • (args: NavigationData): void
        • Parameters

          • args: NavigationData

          Returns void

    • Optional thisArg: any

    Returns any

  • Raised when navigation to the page has finished.

    Parameters

    • event: "navigatedTo"
    • callback: function
        • (args: NavigationData): void
        • Parameters

          • args: NavigationData

          Returns void

    • Optional thisArg: any

    Returns any

onBackPressed

  • onBackPressed(): boolean
  • Derived classes can override this method to handle Android back button press.

    Returns boolean

onLayout

  • onLayout(left: number, top: number, right: number, bottom: number): void
  • Called from layout when this view should assign a size and position to each of its children. Derived classes with children should override this method and call layout on each of their children.

    Parameters

    • left: number

      Left position, relative to parent

    • top: number

      Top position, relative to parent

    • right: number

      Right position, relative to parent

    • bottom: number

      Bottom position, relative to parent

    Returns void

onLoaded

  • onLoaded(): void

onMeasure

  • onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void
  • Measure the view and its content to determine the measured width and the measured height. This method is invoked by measure(int, int) and should be overriden by subclasses to provide accurate and efficient measurement of their contents. When overriding this method, you must call setMeasuredDimension(int, int) to store the measured width and height of this view. Failure to do so will trigger an exception, thrown by measure(int, int).

    Parameters

    • widthMeasureSpec: number

      horizontal space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.

    • heightMeasureSpec: number

      vertical space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.

    Returns void

onResumeNativeUpdates

  • onResumeNativeUpdates(): void

onUnloaded

  • onUnloaded(): void

once

  • once(event: string, callback: function, thisArg?: any): void

Private performNavigation

removeEventListener

  • removeEventListener(eventNames: string, callback?: any, thisArg?: any): void
  • Parameters

    • eventNames: string
    • Optional callback: any
    • Optional thisArg: any

    Returns void

Protected replacePage

  • replacePage(pagePath: string): void

requestLayout

  • requestLayout(): void

resetNativeView

  • resetNativeView(): void

sendAccessibilityEvent

  • sendAccessibilityEvent(options: Partial<AccessibilityEventOptions>): void
  • Send accessibility event

    params

    options AccessibilityEventOptions androidAccessibilityEvent: AndroidAccessibilityEvent; iosNotificationType: IOSPostAccessibilityNotificationType; message: string;

    iOS Notes: type = 'announcement' will announce args via VoiceOver. If no args element will be announced instead. type = 'layout' used when the layout of a screen changes. type = 'screen' large change made to the screen.

    Parameters

    • options: Partial<AccessibilityEventOptions>

    Returns void

set

  • set(name: string, value: any): void

Private setCurrent

  • setCurrent(entry: BackstackEntry, navigationType: NavigationType): void

setInlineStyle

  • setInlineStyle(style: string): void

setMeasuredDimension

  • setMeasuredDimension(measuredWidth: number, measuredHeight: number): void
  • This method must be called by onMeasure(int, int) to store the measured width and measured height. Failing to do so will trigger an exception at measurement time.

    Parameters

    • measuredWidth: number

      The measured width of this view. May be a complex bit mask as defined by MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.

    • measuredHeight: number

      The measured height of this view. May be a complex bit mask as defined by MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.

    Returns void

setNativeView

  • setNativeView(value: any): void

Optional setOnTouchListener

  • setOnTouchListener(): void
  • Android only to set the touch listener

    Returns void

setProperty

  • setProperty(name: string, value: any): void

showModal

toString

  • toString(): string

unbind

  • unbind(property: string): void

unloadView

Static _isEntryBackstackVisible

  • _isEntryBackstackVisible(entry: BackstackEntry): boolean
  • Parameters

    • entry: BackstackEntry

    Returns boolean

Static Private _stack

  • _stack(): Frame[]

Static addEventListener

  • addEventListener(eventName: string, callback: any, thisArg?: any): void
  • Parameters

    • eventName: string
    • callback: any
    • Optional thisArg: any

    Returns void

Static combineMeasuredStates

  • combineMeasuredStates(curState: number, newState: any): number
  • Parameters

    • curState: number
    • newState: any

    Returns number

Static getFrameById

  • getFrameById(id: string): Frame

Static goBack

  • goBack(): any
  • Navigates back using the navigation hierarchy (if any). Updates the Frame stack as needed. This method will start from the topmost Frame and will recursively search for an instance that has the canGoBack operation available.

    Returns any

Static layoutChild

  • layoutChild(parent: View, child: View, left: number, top: number, right: number, bottom: number): void
  • Layout a child by taking into account its margins, horizontal and vertical alignments and a given bounds.

    Parameters

    • parent: View

      This parameter is not used. You can pass null.

    • child: View
    • left: number

      Left position, relative to parent

    • top: number

      Top position, relative to parent

    • right: number

      Right position, relative to parent

    • bottom: number

      Bottom position, relative to parent

    Returns void

Static measureChild

  • measureChild(parent: View, child: View, widthMeasureSpec: number, heightMeasureSpec: number): object
  • Measure a child by taking into account its margins and a given measureSpecs.

    Parameters

    • parent: View

      This parameter is not used. You can pass null.

    • child: View

      The view to be measured.

    • widthMeasureSpec: number
    • heightMeasureSpec: number

    Returns object

    • measuredHeight: number

      The measured height that the parent layout specifies for this view.

    • measuredWidth: number

      The measured width that the parent layout specifies for this view.

Static off

  • off(eventName: string, callback?: any, thisArg?: any): void
  • Parameters

    • eventName: string
    • Optional callback: any
    • Optional thisArg: any

    Returns void

Static on

  • on(eventName: string, callback: any, thisArg?: any): void
  • Parameters

    • eventName: string
    • callback: any
    • Optional thisArg: any

    Returns void

Static once

  • once(eventName: string, callback: any, thisArg?: any): void
  • Parameters

    • eventName: string
    • callback: any
    • Optional thisArg: any

    Returns void

Static Private reloadPage

  • reloadPage(context?: ModuleContext): void
  • Parameters

    • Optional context: ModuleContext

    Returns void

Static removeEventListener

  • removeEventListener(eventName: string, callback?: any, thisArg?: any): void
  • Parameters

    • eventName: string
    • Optional callback: any
    • Optional thisArg: any

    Returns void

Static resolveSizeAndState

  • resolveSizeAndState(size: number, specSize: number, specMode: number, childMeasuredState: number): number
  • Utility to reconcile a desired size and state, with constraints imposed by a MeasureSpec. Will take the desired size, unless a different size is imposed by the constraints. The returned value is a compound integer, with the resolved size in the MEASURED_SIZE_MASK bits and optionally the bit MEASURED_STATE_TOO_SMALL set if the resulting size is smaller than the size the view wants to be.

    Parameters

    • size: number
    • specSize: number
    • specMode: number
    • childMeasuredState: number

    Returns number

Static topmost

  • Gets the topmost frame in the frames stack. An application will typically has one frame instance. Multiple frames handle nested (hierarchical) navigation scenarios.

    Returns Frame

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method