Skip to content

Latest commit

 

History

History
156 lines (111 loc) · 3.48 KB

ViewHelper.md

File metadata and controls

156 lines (111 loc) · 3.48 KB
title ViewHelper
titleTemplate title - API / NativeScript
contributors false

Defined in: ui/core/view/view-helper/index.d.ts:3

Constructors

Constructor

new ViewHelper(): ViewHelper;

Returns

ViewHelper

Methods

combineMeasuredStates()

static combineMeasuredStates(curState: number, newState: any): number;

Defined in: ui/core/view/view-helper/index.d.ts:33

Parameters

Parameter Type
curState number
newState any

Returns

number


layoutChild()

static layoutChild(
   parent: View, 
   child: View, 
   left: number, 
   top: number, 
   right: number, 
   bottom: number): void;

Defined in: ui/core/view/view-helper/index.d.ts:21

Layout a child by taking into account its margins, horizontal and vertical alignments and a given bounds.

Parameters

Parameter Type Description
parent View This parameter is not used. You can pass null.
child View -
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;
  measuredWidth: number;
};

Defined in: ui/core/view/view-helper/index.d.ts:11

Measure a child by taking into account its margins and a given measureSpecs.

Parameters

Parameter Type Description
parent View This parameter is not used. You can pass null.
child View The view to be measured.
widthMeasureSpec number -
heightMeasureSpec number -

Returns

{
  measuredHeight: number;
  measuredWidth: number;
}
measuredHeight
measuredHeight: number;
measuredWidth
measuredWidth: number;

resolveSizeAndState()

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

Defined in: ui/core/view/view-helper/index.d.ts:31

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.

Parameters

Parameter Type
size number
specSize number
specMode number
childMeasuredState number

Returns

number