Skip to content

Height ​

Use this element to control the veertical size of its content.

MethodDescription
HeightSets the exact height of its content.
MinHeightSets the minimum height of its content.
MaxHeightSets the maximum height of its content.

Example ​

The following example demonstrates a container with a fixed height of 100 pt and a width of 200 pt.

csharp
container
    .Width(300)
    .Padding(25)
    .Height(100)
    .AspectRatio(2f, AspectRatioOption.FitHeight)
    .Background(Colors.Grey.Lighten1);

example


DANGER

Please be careful. This component may try to enforce size constraints that are impossible to meet. For example, the container may require more space than is available, or may try to squeeze its child into less space than possible.

Such scenarios result in a layout exception.