pub enum CrossAxisAlignment {
Start,
End,
Center,
Stretch,
Baseline,
}Expand description
How the children should be placed along the cross axis in a flex layout.
See also:
RenderFlex, the flex render object.
Variants§
Start
Place the children with their start edge aligned with the start side of the cross axis.
For example, in a column (a flex with a vertical axis) whose TextDirection is
TextDirection::Ltr, this aligns the left edge of the children along the left edge of
the column.
If this value is used in a horizontal direction, a TextDirection must be available to
determine if the start is the left or the right.
If this value is used in a vertical direction, a VerticalDirection must be available
to determine if the start is the top or the bottom.
End
Place the children as close to the end of the cross axis as possible.
For example, in a column (a flex with a vertical axis) whose TextDirection is
TextDirection::Ltr, this aligns the right edge of the children along the right edge
of the column.
If this value is used in a horizontal direction, a TextDirection must be available to
determine if the end is the left or the right.
If this value is used in a vertical direction, a VerticalDirection must be available
to determine if the end is the top or the bottom.
Center
Place the children so that their centers align with the middle of the cross axis.
This is the default cross-axis alignment.
Stretch
Require the children to fill the cross axis.
This causes the constraints passed to the children to be tight in the cross axis.
Baseline
Place the children along the cross axis such that their baselines match.
Consider using this value for any horizontal main axis (as with a row) where the children primarily contain text.
Because baselines are always horizontal, this alignment is intended for horizontal main
axes. If the main axis is vertical, then this value is treated like
Start.
Children who report no baseline will be top-aligned. No RenderBox reports a baseline
yet, so every child is top-aligned; see PORTING.md.
Trait Implementations§
Source§impl Clone for CrossAxisAlignment
impl Clone for CrossAxisAlignment
impl Copy for CrossAxisAlignment
Source§impl Debug for CrossAxisAlignment
impl Debug for CrossAxisAlignment
impl Eq for CrossAxisAlignment
Source§impl PartialEq for CrossAxisAlignment
impl PartialEq for CrossAxisAlignment
impl StructuralPartialEq for CrossAxisAlignment
Auto Trait Implementations§
impl Freeze for CrossAxisAlignment
impl RefUnwindSafe for CrossAxisAlignment
impl Send for CrossAxisAlignment
impl Sync for CrossAxisAlignment
impl Unpin for CrossAxisAlignment
impl UnsafeUnpin for CrossAxisAlignment
impl UnwindSafe for CrossAxisAlignment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.