Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swiftui image aspect ratio

VStack {
    GeometryReader { geo in
        Image("Example")
            .resizable()
            .aspectRatio(contentMode: .fit)
            .frame(width: geo.size.width, height: 300)
    }
}
Source by www.hackingwithswift.com #
 
PREVIOUS NEXT
Tagged: #swiftui #image #aspect #ratio
ADD COMMENT
Topic
Name
6+1 =