Namespaces
Utils.layout
Utility module related to layout.
Summary ​
Variables
Variables ​
AT_MOST ​
EXACTLY ​
MEASURED_HEIGHT_STATE_SHIFT ​
Bits that provide the actual measured size.
MEASURED_SIZE_MASK ​
MEASURED_STATE_MASK ​
MEASURED_STATE_TOO_SMALL ​
UNSPECIFIED ​
Functions ​
getDisplayDensity ​
Gets display density for the current device.
Returns number
getMeasureSpecMode ​
Gets measure specification mode from a given specification.
Parameter | Default | Description |
spec |
| number The measure specification. |
Returns number
getMeasureSpecSize ​
Gets measure specification size from a given specification.
Parameter | Default | Description |
spec |
| number The measure specification. |
Returns number
getMode ​
Gets layout mode from a given specification as string.
Parameter | Default | Description |
mode |
| number The measure specification mode. |
Returns string
makeMeasureSpec ​
Creates measure specification size from size and mode.
Parameter | Default | Description |
px |
| number |
mode |
| number The mode component of measure specification. |
Returns number
measureNativeView ​
measureNativeView(
nativeView: any,
width: number,
widthMode: number,
height: number,
heightMode: number
): {
height: number
}
Converts device pixels to device independent pixes and measure the nativeView.
Returns the desired size of the nativeView in device pixels.
Parameter | Default | Description |
nativeView |
| any the nativeView to measure (UIView or android.view.View) |
width |
| number the available width |
widthMode |
| number width mode - UNSPECIFIED, EXACTLY or AT_MOST |
height |
| number the available hegiht |
heightMode |
| number height mode - UNSPECIFIED, EXACTLY or AT_MOST |
Returns {
height: number
}
measureSpecToString ​
Prints user friendly version of the measureSpec.
Parameter | Default | Description |
measureSpec |
| number the spec to print |
Returns string
round ​
toDeviceIndependentPixels ​
- Next
- AccessibilityEvents