venik

Aspect ratio

Aspect ratio is the ratio between a node’s width and height: a node with an aspect ratio of 2 is twice as wide as it is tall.

  • Accepts any number greater than 0. The default is unset.
  • Respects the node’s min and max dimensions.
  • Has higher priority than flex grow.
  • If aspect ratio, width and height are all set, the cross-axis dimension is overridden.
node.setAspectRatio(16 / 9);