Scales this view to fit its parent.
On This Page
func scaledToFit() -> some View
A view that scales this view to fit its parent, maintaining this view’s aspect ratio.
This view’s aspect ratio is maintained as the view scales. This method is equivalent to calling aspectRatio(nil, contentMode: .fit).
aspectRatio(nil, contentMode: .fit)
.frame(width: 300, height: 150)
func scaledToFill() -> View
Scales this view to fill its parent.
func scaleEffect(CGFloat, anchor: UnitPoint) -> View
func scaleEffect(x: CGFloat, y: CGFloat, anchor: UnitPoint) -> View
func aspectRatio(CGFloat?, contentMode: ContentMode) -> View
Constrains this view’s dimensions to the specified aspect ratio.
func imageScale(Image.Scale) -> View
Set the image scale within self.
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.