fix button problem

dev_ARKit^2
Rayhân HASSOU 1 year ago
parent d3884adda3
commit 2f8b6b92b9

@ -25,24 +25,25 @@ struct MainMenuButton: View {
var bottomRightCorner: CGFloat = 0 var bottomRightCorner: CGFloat = 0
var body: some View { var body: some View {
Button(text.uppercased()) { Button(action: {
//playSound(named: sound) // playSound(named: sound)
if let onClick: () -> Void { onClick?()
onClick() }) {
} Text(text.uppercased())
.font(.headline)
.fontWeight(.semibold)
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity, maxHeight: 40)
.background(
Color.red
.clipShape(RoundedRectangle(cornerSize: CGSize(width: 0, height: 0)))
.mask(RoundedCornersShape(cornerRadii: (topLeft: topLeftCorner, topRight: topRightCorner, bottomLeft: bottomLeftCorner, bottomRight: bottomRightCorner)))
)
.frame(width: UIScreen.main.bounds.width / 1.7)
.frame(maxWidth: .infinity, alignment: horizontalAlignment)
} }
.font(.headline) .buttonStyle(PlainButtonStyle())
.fontWeight(.semibold)
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity, maxHeight: 40)
.background(
Color.red
.clipShape(RoundedRectangle(cornerSize: CGSize(width: 0, height: 0)))
.mask(RoundedCornersShape(cornerRadii: (topLeft: topLeftCorner, topRight: topRightCorner, bottomLeft: bottomLeftCorner, bottomRight: bottomRightCorner)))
)
.frame(width: UIScreen.main.bounds.width / 1.7)
.frame(maxWidth: .infinity, alignment: horizontalAlignment)
} }
} }

Loading…
Cancel
Save