

NativeScript supports percentage values for width, height and margin. The view is stretched to fill the layout slot of the parent element height takes precedence, if set. The view is aligned to the bottom of the layout slot of the parent element. The view is aligned to the top of the layout slot of the parent element. The following table shows the valid values of verticalAlignment. The view is stretched to fill the layout slot of the parent element width takes precedence, if set. The view is aligned to the right of the layout slot of the parent element. The view is aligned to the center of the layout slot of the parent element. The view is aligned to the left of the layout slot of the parent element. The following table shows the valid values of horizontalAlignment.

Layout applies horizontal and vertical alignment only when an element is allocated more size than it needs. The first value is applied to the top, the second value is applied to the right, the third value is applied to the bottom and the fourth value is applied to the left side (in that order).
