admin管理员组

文章数量:1123157

I managed to create a button that contains an image and text:

When I hover over the button it works as expected. However, there's nothing I can do to reduce the radii. I would have expected that solving this may be straightforward. However, I searched over the internet and asked ChatGPT how to do this, but I couldn't manage. This is the code I have so far:

            Button(action: {
                domainManager.bcDomain.setCase1()
            }) {
                VStack(spacing: 8) { // Add spacing between image and text
                    Image("schematic_cantilever")
                        .renderingMode(.original)
                        .resizable()
                        .scaledToFit()
                        .frame(width: 150, height: 100)

                    Text("Case 1")
                        .font(.headline)
                        .foregroundColor(.primary) // Adaptive text color
                }
                .padding(20)
            }

本文标签: SwiftUI button with image and text not working as expectedStack Overflow