pub struct ViewDimensions {
pub width: f64,
pub height: f64,
}Expand description
How big the view being aligned is.
SwiftUI hands an alignment guide a ViewDimensions, and the guide is
expected to answer in terms of it — d.width / 2 centres, d.width
puts the edge at the far side. The binding ignored it, so a guide could
only return a constant, which is the one kind of guide that does not need
the modifier at all.
width and height are read through SwiftUI’s own getters. The two
remaining accessors — the [HorizontalAlignment] and [VerticalAlignment]
subscripts, which is how Swift writes d[.leading] — are @inlinable and
export no symbol, so they are not here.
Fields§
§width: f64The view’s width.
height: f64The view’s height.
Trait Implementations§
Source§impl Clone for ViewDimensions
impl Clone for ViewDimensions
impl Copy for ViewDimensions
Source§impl Debug for ViewDimensions
impl Debug for ViewDimensions
Source§impl Default for ViewDimensions
impl Default for ViewDimensions
Source§impl PartialEq for ViewDimensions
impl PartialEq for ViewDimensions
impl StructuralPartialEq for ViewDimensions
Auto Trait Implementations§
impl Freeze for ViewDimensions
impl RefUnwindSafe for ViewDimensions
impl Send for ViewDimensions
impl Sync for ViewDimensions
impl Unpin for ViewDimensions
impl UnsafeUnpin for ViewDimensions
impl UnwindSafe for ViewDimensions
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