Skip to content

Instantly share code, notes, and snippets.

@hirauchg
Created August 18, 2020 07:54
Show Gist options
  • Save hirauchg/b0e1d0a403f2edc896629f182be347e6 to your computer and use it in GitHub Desktop.
Save hirauchg/b0e1d0a403f2edc896629f182be347e6 to your computer and use it in GitHub Desktop.
画像のサイズを変更する
struct ContentView: View {
var body: some View {
VStack {
Image("soccer")
Image("soccer")
.resizable()
.scaledToFit()
.frame(width: 200, height: 100)
Image("soccer")
.resizable()
.scaledToFill()
.frame(width: 200, height: 300)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment