Help prepare for 2025 → Answer 8 simple questions on our Fall Survey
Open Survey
ViewCommon

Summary

Constructors

constructor

Properties

_androidContentDescriptionUpdated
_closeModalCallback
_currentHeightMeasureSpec
_currentWidthMeasureSpec
_gestureObservers
_isLayoutValid
_manager
_modalParent
_setMinHeightNative
_setMinWidthNative
accessibilityBlurEvent
accessibilityFocusChangedEvent
accessibilityFocusEvent
accessibilityHint
accessibilityIdentifier
accessibilityLabel
accessibilityPerformEscapeEvent
accessibilityValue
ignoreTouchAnimation
iosIgnoreSafeArea
iosOverflowSafeArea
iosOverflowSafeAreaEnabled
isEnabled
isUserInteractionEnabled
layoutChangedEvent
originX
originY
showingModallyEvent
shownModallyEvent
testID
touchAnimation
touchDelay
transitionId

Accessors

accessibilityHidden
accessibilityLanguage
accessibilityLiveRegion
accessibilityMediaSession
accessibilityRole
accessibilityState
accessible
androidDynamicElevationOffset
androidElevation
automationText
background
backgroundColor
backgroundImage
backgroundPosition
backgroundRepeat
backgroundSize
borderBottomColor
borderBottomLeftRadius
borderBottomRightRadius
borderBottomWidth
borderColor
borderLeftColor
borderLeftWidth
borderRadius
borderRightColor
borderRightWidth
borderTopColor
borderTopLeftRadius
borderTopRightRadius
borderTopWidth
borderWidth
boxShadow
color
css
cssType
height
horizontalAlignment
iosAccessibilityAdjustsFontSize
iosAccessibilityMaxFontScale
iosAccessibilityMinFontScale
isLayoutRequired
isLayoutValid
margin
marginBottom
marginLeft
marginRight
marginTop
minHeight
minWidth
modal
opacity
perspective
rotate
rotateX
rotateY
scaleX
scaleY
textTransform
translateX
translateY
verticalAlignment
visibility
width
9 accessors inherited from ViewBase
Click to expand

Methods

_applyBackground
_closeAllModalViewsInternal
_eachLayoutView
_getCurrentLayoutBounds
_getFragmentManager
_getNativeViewsCount
_getRootModalViews
_getValue
_handleLivesync
_hasAncestorView
_hideNativeModalView
_observe
_onAttachedToWindow
_onDetachedFromWindow
_onLivesync
_raiseLayoutChangedEvent
_raiseShowingModallyEvent
_raiseShownModallyEvent
_redrawNativeBackground
_removeAnimation
_setCurrentLayoutBounds
_setCurrentMeasureSpecs
_setNativeClipToBounds
_setNativeViewFrame
_setupAsRootView
_setValue
_showNativeModalView
_updateEffectiveLayoutValues
_updateStyleScope
accessibilityAnnouncement
accessibilityScreenChanged
addCss
addCssFile
addEventListener
animate
changeCssFile
closeModal
combineMeasuredStates
createAnimation
eachChild
eachChildView
focus
getActualSize
getGestureObservers
getLocationInWindow
getLocationOnScreen
getLocationRelativeTo
getMeasuredHeight
getMeasuredState
getMeasuredWidth
getSafeAreaInsets
layout
layoutChild
layoutNativeView
measure
measureChild
onBackPressed
onLayout
onLoaded
onMeasure
removeEventListener
requestLayout
resetNativeView
resolveSizeAndState
sendAccessibilityEvent
setMeasuredDimension
setTestID
showModal

Constructors

constructor

new ViewCommon(): ViewCommon

Properties

_androidContentDescriptionUpdated

_androidContentDescriptionUpdated?: boolean

_closeModalCallback

Protected
_closeModalCallback: Function

_currentHeightMeasureSpec

_currentHeightMeasureSpec: number

_currentWidthMeasureSpec

_currentWidthMeasureSpec: number

_gestureObservers

_isLayoutValid

Protected

_setMinHeightNative

_setMinHeightNative: (value: LengthType) => void

_setMinWidthNative

_setMinWidthNative: (value: LengthType) => void

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

touchAnimation

touchDelay

transitionId

transitionId: number
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

get background(): string

backgroundColor

get backgroundColor(): Color

backgroundImage

get backgroundImage(): string | LinearGradient
Returns string | LinearGradient

backgroundPosition

get backgroundPosition(): string

backgroundSize

get backgroundSize(): string

borderBottomColor

get borderBottomColor(): Color

borderBottomLeftRadius

get borderBottomLeftRadius(): LengthType

borderBottomRightRadius

get borderBottomRightRadius(): LengthType

borderBottomWidth

borderColor

get borderColor(): string | Color

borderLeftColor

get borderLeftColor(): Color

borderLeftWidth

borderRadius

get borderRadius(): string | number | LengthDipUnit | LengthPxUnit

borderRightColor

get borderRightColor(): Color

borderRightWidth

borderTopColor

get borderTopColor(): Color

borderTopLeftRadius

borderTopRightRadius

borderTopWidth

borderWidth

get borderWidth(): string | number | LengthDipUnit | LengthPxUnit

boxShadow

get boxShadow(): CSSShadow

css

get css(): string

cssType

get cssType(): string

iosAccessibilityAdjustsFontSize

get iosAccessibilityAdjustsFontSize(): boolean

iosAccessibilityMaxFontScale

get iosAccessibilityMaxFontScale(): number

iosAccessibilityMinFontScale

get iosAccessibilityMinFontScale(): number

isLayoutRequired

get isLayoutRequired(): boolean

isLayoutValid

get isLayoutValid(): boolean

opacity

get opacity(): number

perspective

get perspective(): number

rotate

get rotate(): number

rotateX

get rotateX(): number

rotateY

get rotateY(): number

scaleX

get scaleX(): number

scaleY

get scaleY(): number

translateX

get translateX(): number

translateY

get translateY(): number

Methods

_applyBackground

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

isBorderDrawable
boolean

onlyColor
boolean

backgroundDrawable
any

Returns void

_closeAllModalViewsInternal

_closeAllModalViewsInternal(): boolean

_eachLayoutView

_eachLayoutView(callback: (View: any) => void): void
Parameter Default Description
callback
(View: any) => void

Returns void

_getCurrentLayoutBounds

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

_getFragmentManager

_getFragmentManager(): any

_getNativeViewsCount

_getNativeViewsCount(): number

_getRootModalViews

_getRootModalViews(): ViewBase[]

_getValue

_getValue(): never

_handleLivesync

_handleLivesync(context?: ModuleContext): boolean
Parameter Default Description
context
ModuleContext

Returns boolean

_hasAncestorView

_hasAncestorView(ancestorView: View): boolean
Parameter Default Description
ancestorView

Returns boolean

_hideNativeModalView

Protected
_hideNativeModalView(parent: ViewCommon, whenClosedCallback: () => void): void
Parameter Default Description
parent

whenClosedCallback
() => void

Returns void

_observe

_observe(type: GestureTypes, callback: (args: GestureEventData) => void, thisArg?: any): void
Parameter Default Description
type

callback
(args: GestureEventData) => void

thisArg
any

Returns void

_onAttachedToWindow

_onAttachedToWindow(): void

_onDetachedFromWindow

_onDetachedFromWindow(): void

_onLivesync

_onLivesync(context?: ModuleContext): boolean
Parameter Default Description
context
ModuleContext

Returns boolean

_raiseLayoutChangedEvent

Protected
_raiseLayoutChangedEvent(): void

_raiseShowingModallyEvent

Protected
_raiseShowingModallyEvent(): void

_raiseShownModallyEvent

Protected
_raiseShownModallyEvent(): void

_redrawNativeBackground

_redrawNativeBackground(value: any): void
Parameter Default Description
value
any

Returns void

_removeAnimation

_removeAnimation(animation: Animation): boolean
Parameter Default Description
animation

Returns boolean

_setCurrentLayoutBounds

_setCurrentLayoutBounds(
  left: number,
  top: number,
  right: number,
  bottom: number
): {
  boundsChanged: boolean
}
Returns two booleans - the first if "boundsChanged" the second is "sizeChanged".
Parameter Default Description
left
number

top
number

right
number

bottom
number

Returns { boundsChanged: boolean }

_setCurrentMeasureSpecs

_setCurrentMeasureSpecs(
  widthMeasureSpec: number,
  heightMeasureSpec: number
): boolean
Parameter Default Description
widthMeasureSpec
number

heightMeasureSpec
number

Returns boolean

_setNativeClipToBounds

_setNativeClipToBounds(): void

_setNativeViewFrame

_setNativeViewFrame(nativeView: any, frame: any): void
Parameter Default Description
nativeView
any

frame
any

Returns void

_setValue

_setValue(): never

_setupAsRootView

_setupAsRootView(context: any): void
Parameter Default Description
context
any

Returns void

_showNativeModalView

Protected
_showNativeModalView(parent: ViewCommon, options: ShowModalOptions): void
Parameter Default Description
parent

options

Returns void

_updateEffectiveLayoutValues

_updateEffectiveLayoutValues(
  parentWidthMeasureSize: number,
  parentWidthMeasureMode: number,
  parentHeightMeasureSize: number,
  parentHeightMeasureMode: number
): void
Parameter Default Description
parentWidthMeasureSize
number

parentWidthMeasureMode
number

parentHeightMeasureSize
number

parentHeightMeasureMode
number

Returns void

_updateStyleScope

_updateStyleScope(
  cssFileName?: string,
  cssString?: string,
  css?: string
): void
Parameter Default Description
cssFileName
string

cssString
string

css
string

Returns void

accessibilityAnnouncement

accessibilityAnnouncement(msg?: string): void
Parameter Default Description
msg
string

Returns void

accessibilityScreenChanged

accessibilityScreenChanged(): void

addCss

addCss(cssString: string): void
Parameter Default Description
cssString
string

Returns void

addCssFile

addCssFile(cssFileName: string): void
Parameter Default Description
cssFileName
string

Returns void

addEventListener

addEventListener(arg: string | GestureTypes, callback: (data: EventData) => void, thisArg?: any): void
Parameter Default Description
arg
string | GestureTypes

callback
(data: EventData) => void

thisArg
any

Returns void

animate

animate(animation: any): AnimationPromise
Parameter Default Description
animation
any

Returns AnimationPromise

changeCssFile

changeCssFile(cssFileName: string): void
Parameter Default Description
cssFileName
string

Returns void

closeModal

closeModal(...args: any[]): void
Parameter Default Description
args
any[]

Returns void

createAnimation

createAnimation(animation: any): Animation
Parameter Default Description
animation
any

Returns Animation

eachChild

eachChild(callback: (child: ViewBase) => boolean): void
Parameter Default Description
callback
(child: ViewBase) => boolean

Returns void

eachChildView

eachChildView(callback: (view: View) => boolean): void
Parameter Default Description
callback
(view: View) => boolean

Returns void

focus

focus(): boolean

getActualSize

getGestureObservers

getGestureObservers(type: GestureTypes): GesturesObserver[]
Parameter Default Description
type

Returns GesturesObserver[]

getLocationInWindow

getLocationInWindow(): Point

getLocationOnScreen

getLocationOnScreen(): Point

getLocationRelativeTo

getLocationRelativeTo(otherView: View): Point
Parameter Default Description
otherView

Returns 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
Parameter Default Description
left
number

top
number

right
number

bottom
number

Returns void

layoutNativeView

Abstract
layoutNativeView(
  left: number,
  top: number,
  right: number,
  bottom: number
): void
Parameter Default Description
left
number

top
number

right
number

bottom
number

Returns void

measure

measure(widthMeasureSpec: number, heightMeasureSpec: number): void
Parameter Default Description
widthMeasureSpec
number

heightMeasureSpec
number

Returns void

onBackPressed

onBackPressed(): boolean

onLayout

Abstract
onLayout(left: number, top: number, right: number, bottom: number): void
Parameter Default Description
left
number

top
number

right
number

bottom
number

Returns void

onLoaded

onLoaded(): void

onMeasure

Abstract
onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void
Parameter Default Description
widthMeasureSpec
number

heightMeasureSpec
number

Returns void

removeEventListener

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

callback
(data: EventData) => void

thisArg
any

Returns void

requestLayout

requestLayout(): void

resetNativeView

resetNativeView(): void

sendAccessibilityEvent

sendAccessibilityEvent(options: Partial<AccessibilityEventOptions>): void
Parameter Default Description
options
Partial<AccessibilityEventOptions>

Returns void

setMeasuredDimension

setMeasuredDimension(measuredWidth: number, measuredHeight: number): void
Parameter Default Description
measuredWidth
number

measuredHeight
number

Returns void

setTestID

setTestID(view: any, value: string): void
Parameter Default Description
view
any

value
string

Returns void

showModal

showModal(...args: any[]): View
Parameter Default Description
args
any[]

Returns View

combineMeasuredStates

Static
combineMeasuredStates(curState: number, newState: any): number
Parameter Default Description
curState
number

newState
any

Returns number

layoutChild

Static
layoutChild(parent: View, child: View, left: number, top: number, right: number, bottom: number, setFrame?: boolean): void
Parameter Default Description
parent

child

left
number

top
number

right
number

bottom
number

setFrame
boolean

Returns void

measureChild

Static
measureChild(parent: ViewCommon, child: ViewCommon, widthMeasureSpec: number, heightMeasureSpec: number): {
  measuredHeight: number
}
Parameter Default Description
parent

child

widthMeasureSpec
number

heightMeasureSpec
number

Returns { measuredHeight: number }

resolveSizeAndState

Static
resolveSizeAndState(
  size: number,
  specSize: number,
  specMode: number,
  childMeasuredState: number
): number
Parameter Default Description
size
number

specSize
number

specMode
number

childMeasuredState
number

Returns number
Previous
ViewBase