8.7 released—WinterCG Compliance Part 1
Learn more
ViewHelper

Summary

Constructors

constructor

new ViewHelper(): ViewHelper
Returns ViewHelper

Methods

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): void
Layout a child by taking into account its margins, horizontal and vertical alignments and a given bounds.
Parameter Default Description
parent

This parameter is not used. You can pass null.

child

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

measureChild

Static
measureChild(parent: View, child: View, widthMeasureSpec: number, heightMeasureSpec: number): {
  measuredHeight: number
}
Measure a child by taking into account its margins and a given measureSpecs.
Parameter Default Description
parent

This parameter is not used. You can pass null.

child

The view to be measured.

widthMeasureSpec
number

heightMeasureSpec
number

Returns { measuredHeight: number }

resolveSizeAndState

Static
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.
Parameter Default Description
size
number

specSize
number

specMode
number

childMeasuredState
number

Returns number
Previous
ViewCommon