ViewCommon | API - NativeScript

Summary

Constructors

constructor

Properties

_androidContentDescriptionUpdated

_androidContentDescriptionUpdated?: boolean

_closeModalCallback

Protected

_closeModalCallback: Function

_currentHeightMeasureSpec

_currentHeightMeasureSpec: number

_currentWidthMeasureSpec

_currentWidthMeasureSpec: number

_gestureObservers

_isLayoutValid

Protected

_manager

_modalParent

_setMinHeightNative

_setMinWidthNative

accessibilityHint

accessibilityHint: string

accessibilityIdentifier

accessibilityIdentifier: string

accessibilityLabel

accessibilityLabel: string

accessibilityValue

accessibilityValue: string

ignoreTouchAnimation

ignoreTouchAnimation: boolean

iosIgnoreSafeArea

iosIgnoreSafeArea: boolean

iosOverflowSafeArea

iosOverflowSafeArea: boolean

iosOverflowSafeAreaEnabled

iosOverflowSafeAreaEnabled: boolean

isEnabled

isUserInteractionEnabled

isUserInteractionEnabled: boolean

originX

originY

testID

touchAnimation

touchDelay

transitionId

Active transition instance id for tracking state

accessibilityBlurEvent

Static

accessibilityBlurEvent: string

accessibilityFocusChangedEvent

Static

accessibilityFocusChangedEvent: string

accessibilityFocusEvent

Static

accessibilityFocusEvent: string

accessibilityPerformEscapeEvent

Static

accessibilityPerformEscapeEvent: string

layoutChangedEvent

Static

layoutChangedEvent: string

showingModallyEvent

Static

showingModallyEvent: string

shownModallyEvent

Static

shownModallyEvent: string

Accessors

accessibilityHidden

get accessibilityHidden(): boolean

accessibilityLanguage

get accessibilityLanguage(): string

accessibilityLiveRegion

accessibilityMediaSession

get accessibilityMediaSession(): boolean

accessibilityRole

accessibilityState

accessible

get accessible(): boolean

androidDynamicElevationOffset

get androidDynamicElevationOffset(): number

androidElevation

get androidElevation(): number

automationText

get automationText(): string

background

backgroundColor

get backgroundColor(): Color

backgroundImage

get backgroundImage(): string | LinearGradient

Returns string | LinearGradient

backgroundPosition

get backgroundPosition(): string

backgroundRepeat

backgroundSize

get backgroundSize(): string

borderBottomColor

get borderBottomColor(): Color

borderBottomLeftRadius

borderBottomRightRadius

borderBottomWidth

borderColor

get borderColor(): string | Color

borderLeftColor

get borderLeftColor(): Color

borderLeftWidth

borderRadius

borderRightColor

get borderRightColor(): Color

borderRightWidth

borderTopColor

get borderTopColor(): Color

borderTopLeftRadius

borderTopRightRadius

borderTopWidth

borderWidth

boxShadow

get boxShadow(): CSSShadow

color

css

cssType

height

horizontalAlignment

iosAccessibilityAdjustsFontSize

get iosAccessibilityAdjustsFontSize(): boolean

iosAccessibilityMaxFontScale

get iosAccessibilityMaxFontScale(): number

iosAccessibilityMinFontScale

get iosAccessibilityMinFontScale(): number

isLayoutRequired

get isLayoutRequired(): boolean

isLayoutValid

get isLayoutValid(): boolean

margin

marginBottom

marginLeft

marginRight

marginTop

minHeight

minWidth

opacity

perspective

get perspective(): number

rotate

rotateX

rotateY

scaleX

scaleY

textTransform

translateX

translateY

verticalAlignment

visibility

width

Methods

_applyBackground

_applyBackground(
  background: any,
  isBorderDrawable: boolean,
  onlyColor: boolean,
  backgroundDrawable: any
): void

_closeAllModalViewsInternal

_closeAllModalViewsInternal(): boolean

_eachLayoutView

_eachLayoutView(callback: (View: any) => void): void

_getCurrentLayoutBounds

_getCurrentLayoutBounds(): {
  bottom: number
  left: number
  right: number
}

Returns { bottom: number left: number right: number }

_getFragmentManager

_getFragmentManager(): any

_getNativeViewsCount

_getNativeViewsCount(): number

_getRootModalViews

_getValue

_handleLivesync

_handleLivesync(context?: ModuleContext): boolean

_hasAncestorView

_hasAncestorView(ancestorView: View): boolean

_hideNativeModalView

Protected

_hideNativeModalView(parent: ViewCommon, whenClosedCallback: () => void): void

_observe

_onAttachedToWindow

_onAttachedToWindow(): void

_onDetachedFromWindow

_onDetachedFromWindow(): void

_onLivesync

_onLivesync(context?: ModuleContext): boolean

_raiseLayoutChangedEvent

Protected

_raiseLayoutChangedEvent(): void

_raiseShowingModallyEvent

Protected

_raiseShowingModallyEvent(): void

_raiseShownModallyEvent

Protected

_raiseShownModallyEvent(): void

_redrawNativeBackground

_redrawNativeBackground(value: any): void

_removeAnimation

_removeAnimation(animation: Animation): boolean

_setCurrentLayoutBounds

_setCurrentLayoutBounds(
  left: number,
  top: number,
  right: number,
  bottom: number
): {
  boundsChanged: boolean
}

Returns two booleans - the first if "boundsChanged" the second is "sizeChanged".

Returns { boundsChanged: boolean }

_setCurrentMeasureSpecs

_setCurrentMeasureSpecs(
  widthMeasureSpec: number,
  heightMeasureSpec: number
): boolean

_setNativeClipToBounds

_setNativeClipToBounds(): void

_setNativeViewFrame

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

_setValue

_setupAsRootView

_setupAsRootView(context: any): void

_showNativeModalView

Protected

_updateEffectiveLayoutValues

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

_updateStyleScope

_updateStyleScope(
  cssFileName?: string,
  cssString?: string,
  css?: string
): void

accessibilityAnnouncement

accessibilityAnnouncement(msg?: string): void

accessibilityScreenChanged

accessibilityScreenChanged(): void

addCss

addCss(cssString: string): void

addCssFile

addCssFile(cssFileName: string): void

addEventListener

animate

animate(animation: any): AnimationPromise

changeCssFile

changeCssFile(cssFileName: string): void

closeModal

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

createAnimation

eachChild

eachChild(callback: (child: ViewBase) => boolean): void

eachChildView

eachChildView(callback: (view: View) => boolean): void

focus

getActualSize

getGestureObservers

getLocationInWindow

getLocationInWindow(): Point

getLocationOnScreen

getLocationOnScreen(): Point

getLocationRelativeTo

getLocationRelativeTo(otherView: View): Point

getMeasuredHeight

getMeasuredHeight(): number

getMeasuredState

getMeasuredState(): number

getMeasuredWidth

getMeasuredWidth(): number

getSafeAreaInsets

getSafeAreaInsets(): {
  bottom: any
  left: any
  right: any
}

Returns { bottom: any left: any right: any }

layout

layout(left: number, top: number, right: number, bottom: number): void

layoutNativeView

Abstract

layoutNativeView(
  left: number,
  top: number,
  right: number,
  bottom: number
): void

measure

measure(widthMeasureSpec: number, heightMeasureSpec: number): void

onBackPressed

onLayout(left: number, top: number, right: number, bottom: number): void

onLoaded

onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void

removeEventListener

removeEventListener(arg: string | GestureTypes, callback?: (data: EventData) => void, thisArg?: any): void

requestLayout

resetNativeView

sendAccessibilityEvent

sendAccessibilityEvent(options: Partial<AccessibilityEventOptions>): void

setMeasuredDimension

setMeasuredDimension(measuredWidth: number, measuredHeight: number): void

setTestID

setTestID(view: any, value: string): void

showModal

showModal(...args: any[]): View

combineMeasuredStates

Static

combineMeasuredStates(curState: number, newState: any): number
layoutChild(parent: View, child: View, left: number, top: number, right: number, bottom: number, setFrame?: boolean): void
measureChild(parent: ViewCommon, child: ViewCommon, widthMeasureSpec: number, heightMeasureSpec: number): {
  measuredHeight: number
}

Returns { measuredHeight: number }

resolveSizeAndState

Static

resolveSizeAndState(
  size: number,
  specSize: number,
  specMode: number,
  childMeasuredState: number
): number