Summary: Fixes #313 https://github.com/facebook/yoga/issues/313 Reviewed By: gkassabli Differential Revision: D4397691 fbshipit-source-id: 29daabe9a4bbde3f330e952ca5e644c7cfdbcccf
2.0 KiB
2.0 KiB
docid, title, layout, permalink
docid | title | layout | permalink |
---|---|---|---|
aspect-ratio | Aspect ratio | docs | /docs/aspect-ratio/ |
AspectRatio
is a property introduced by Yoga. AspectRatio
solves the problem of knowing one dimension of an element and an aspect ratio, this is very common when it comes to videos, images, and other media types. AspectRatio
accepts any floating point value > 0, the default is undefined.
AspectRatio
is defined as the ratio between the width and the height of a node e.g. if a node has an aspect ratio of 2 then its width is twice the size of its height.AspectRatio
respects theMin
andMax
dimensions of an item.AspectRatio
has higher priority thanFlexGrow
- If
AspectRatio
,Width
, andHeight
are set then the cross dimension is overridden.