pub struct Frame { /* private fields */ }Expand description
A view that provides a frame with optional size constraints and alignment for its child.
The Frame view allows you to specify minimum, ideal, and maximum dimensions for width and height, and controls how the child is aligned within the frame.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn new(content: impl View) -> Self
pub fn new(content: impl View) -> Self
Creates a new Frame with the specified content and alignment.
§Arguments
content- The child view to be contained within the framealignment- How the child should be aligned within the frame
Sourcepub const fn alignment(self, alignment: Alignment) -> Self
pub const fn alignment(self, alignment: Alignment) -> Self
Sets the alignment of the child within the frame.
§Arguments
alignment- The alignment to apply to the child view
Sourcepub const fn min_height(self, height: f32) -> Self
pub const fn min_height(self, height: f32) -> Self
Sets the minimum height of the frame.
Sourcepub const fn max_height(self, height: f32) -> Self
pub const fn max_height(self, height: f32) -> Self
Sets the maximum height of the frame.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Frame
impl !RefUnwindSafe for Frame
impl !Send for Frame
impl !Sync for Frame
impl Unpin for Frame
impl !UnwindSafe for Frame
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
Mutably borrows from an owned value. Read more