I'm trying to add both Text
and Image
on Button
like:
Button(action: {}) {
Image("gift")
Text("Send")
.padding(.horizontal)
}
.padding()
.foregroundColor(.white)
.background(Color.gray)
.cornerRadius(.infinity)
Button looks:
But I want to create this:
Thanks
Just put the Image
and Text
inside an HStack
…
Button(action: {}) {
HStack {
Image(systemName: "gift")
Text("Send")
}
}
.padding()
.foregroundColor(.white)
.background(Color.gray)
.cornerRadius(.infinity)