Last active
January 23, 2021 00:50
-
-
Save oocoocococo/8c2596bef219f474b11258ffc271225b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
TabView { | |
VStack { | |
Text("Assets.xcassetsでAccentColorに赤を指定") | |
.padding() | |
Button("ボタン(色指定なし)", action: {}) | |
.padding() | |
Button("ボタン(accentColorを上書き)", action: {}) | |
.padding() | |
.accentColor(.purple) // accentColorを上書き | |
Toggle(isOn: .constant(true), label: { | |
Text("スイッチ (色指定なし)") | |
}) | |
.padding() | |
Toggle(isOn: .constant(true), label: { | |
Text("スイッチ (accentColorを指定)") | |
}) | |
.padding() | |
.toggleStyle(SwitchToggleStyle(tint: .accentColor)) // ToggleにaccentColorを指定 | |
} | |
.tabItem { | |
Image(systemName: "circle.fill") | |
Text("丸") | |
} | |
Text("三角のビュー") | |
.tabItem { | |
Image(systemName: "triangle.fill") | |
Text("三角") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment