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
版权声明:本文标题:SwiftUI button with image and text not working as expected - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736551340a1944514.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论