measure

open fun measure(context: Context, localData: ReadableMap, props: ReadableMap, state: ReadableMap, width: Float, widthMode: YogaMeasureMode, height: Float, heightMode: YogaMeasureMode, @Nullable attachmentsPositions: Array<Float>): Long

Subclasses can override this method to implement custom measure functions for the ViewManager

Return

result of calculation of layout for the arguments received as a parameter.

Parameters

context
localData

ReadableMap containing "local data" defined in C++

props

ReadableMap containing JS props

state

ReadableMap containing state defined in C++

width

width of the view (usually zero)

widthMode

widthMode used during calculation of layout

height

height of the view (usually zero)

heightMode

widthMode used during calculation of layout

attachmentsPositions

array containing 2x times the amount of attachments of the view. An attachment represents the position of an inline view that needs to be rendered inside a component and it requires the content of the parent view in order to be positioned. This array is meant to be used by the platform to RETURN the position of each attachment, as a result of the calculation of layout. (e.g. this array is used to measure inlineViews that are rendered inside Text components). On most of the components this array will be contain a null value.

Even values will represent the TOP of each attachment, Odd values represent the LEFT of each attachment.


open fun measure(context: Context, localData: MapBuffer, props: MapBuffer, @Nullable state: MapBuffer, width: Float, widthMode: YogaMeasureMode, height: Float, heightMode: YogaMeasureMode, @Nullable attachmentsPositions: Array<Float>): Long

THIS MEASURE METHOD IS EXPERIMENTAL, MOST LIKELY YOU ARE LOOKING TO USE THE OTHER OVERLOAD INSTEAD: measure

Subclasses can override this method to implement custom measure functions for the ViewManager

Return

result of calculation of layout for the arguments received as a parameter.

Parameters

context
localData

MapBuffer containing "local data" defined in C++

props

MapBuffer containing JS props

state

MapBuffer containing state defined in C++

width

width of the view (usually zero)

widthMode

widthMode used during calculation of layout

height

height of the view (usually zero)

heightMode

widthMode used during calculation of layout

attachmentsPositions

array containing 2x times the amount of attachments of the view. An attachment represents the position of an inline view that needs to be rendered inside a component and it requires the content of the parent view in order to be positioned. This array is meant to be used by the platform to RETURN the position of each attachment, as a result of the calculation of layout. (e.g. this array is used to measure inlineViews that are rendered inside Text components). On most of the components this array will be contain a null value.

Even values will represent the TOP of each attachment, Odd values represent the LEFT of each attachment.