Reputation: 93
I have a label with a custom Image. I want to make the Image resizable, but I can't find any way to do this. Here is my code ;
Label("Continue with Google", image: "googleLogo")
.foregroundColor(.white)
.background(Color.red)
Any help is appreciated!
Upvotes: 5
Views: 6037
Reputation: 281
You can write like this:
Label {
Text("Continue with Google")
} icon: {
Image("googleLogo")
.resizable()
.scaledToFit()
}
Hope it can help you.
Upvotes: 17