どうも、ちょげ(@chogetarou)です。
Buttonの背景色を変える方法を紹介します。
方法

Buttonの背景色を変えるには、background修飾子を使います。
まず、Buttonにbackground修飾子を付与します。
そして、background修飾子の引数に背景色を指定します。
Button(・・・)
.background(color) //引数に背景色を指定
background修飾子の引数に指定した色が、Buttonの背景色になります。
使用例

struct ContentView: View {
var body: some View {
VStack {
Button(action: {}) {
Text("Button")
.foregroundColor(.white)
.padding(20)
}
.background(Color.pink)
}
}
}
コメント