pub enum ContentMode {
Fit,
Fill,
}Expand description
SwiftUI.ContentMode — whether content fits inside its frame or fills it.
The enum aspectRatio and Image.resizable take. It is frozen and one byte,
so the case number is the ABI: fit is 0 and fill is 1, which is what
aspect_ratio’s bool has always passed. This gives it its name back,
because aspect_ratio(&v, 1.5, true) does not read as “fill”.
Variants§
Fit
Scale to fit inside the frame, leaving empty space along one axis.
Fill
Scale to fill the frame, cropping along one axis.
Trait Implementations§
Source§impl Clone for ContentMode
impl Clone for ContentMode
impl Copy for ContentMode
Source§impl Debug for ContentMode
impl Debug for ContentMode
Source§impl Default for ContentMode
impl Default for ContentMode
impl Eq for ContentMode
Source§impl From<Fill> for ContentMode
impl From<Fill> for ContentMode
Source§impl From<Fit> for ContentMode
impl From<Fit> for ContentMode
Source§impl PartialEq for ContentMode
impl PartialEq for ContentMode
impl StructuralPartialEq for ContentMode
Auto Trait Implementations§
impl Freeze for ContentMode
impl RefUnwindSafe for ContentMode
impl Send for ContentMode
impl Sync for ContentMode
impl Unpin for ContentMode
impl UnsafeUnpin for ContentMode
impl UnwindSafe for ContentMode
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