Can't do math in UIAspectRatioConstraint.AspectRatio

UIAspectRatioConstraint.AspectRatio does not support math operations. It is common to use fractions and ratios when dealing with aspect ratios, so to set the aspect ratio to 16/9 I have to first print it using command line or something then copy paste it into the aspect ratio value

image

4 Likes

i would use a script inside the instance to calculate whatever and then put the result as the aspect ratio

2 Likes

Looks like the property type is a clamped number, which doesn’t support expressionEval, like many others.

2 Likes

It’s not only for aspect ratio but is probably also for all values that are clamped.

1 Like

Thanks for the report! I filed a ticket in our internal database.