Constant freya_elements::elements::rect::cross_align
source · pub const cross_align: (&'static str, Option<&'static str>, bool);
Expand description
§cross_align
Control how the inner elements are positioned inside the element in the axis perpendicular to the direction.
Accepted values:
start
(default): At the begining of the axis (same as inmain_align
)center
: At the center of the axis (same as inmain_align
)end
: At the end of the axis (same as inmain_align
)
When using the vertical
direction it uses the X axis and in horizontal
direction it uses the Y axis.
Example on how to center the inner elements in the cross axis:
fn app() -> Element {
rsx!(
rect {
width: "100%",
height: "100%",
cross_align: "center",
rect {
width: "50%",
height: "50%",
background: "red"
},
}
)
}