PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

AspectRatio

UIAspectRatioConstraint

float

AspectRatio determines the width-to-height ratio to maintain. To flip the ratio to height-to-width, take the inverse (divide 1 by the number or raise to the -1st power). This value must be greater than zero. Below, a white Frame is placed within the a black Frame with two different width-to-height ratios.

A width-to-height ratio of 0.8A width-to-height ratio of 1.25