I have the following code to show an image:
struct TransactionsButtonView : View {
var body: some View {
return VStack {
Image("Transactions")
Text("Transactions")
.font(.footnote)
}.padding(.horizontal)
}
}
This creates an image properly:

However when I try to convert it to an image button, it only shows blue:
struct TransactionsButtonView : View {
var body: some View {
return VStack {
Button(action: { self.showTransactions() }) {
Image("Transactions")
}
Text("Transactions")
.font(.footnote)
}.padding(.horizontal)
}
func showTransactions() {
}
}

How do I get my button to show the image?
You have to modify your image with the renderingMode by adding the following property:
Image("Transactions").renderingMode(.original)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With