Created
October 23, 2024 12:46
-
-
Save takoikatakotako/5f3c8d7835e583005dc4aaa45abcbc59 to your computer and use it in GitHub Desktop.
SwiftUIで少しカスタマイズしたインディケーターを表示する
This file contains hidden or 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 { | |
| @State var showingIndicator = true | |
| var body: some View { | |
| ZStack { | |
| VStack { | |
| Spacer() | |
| Button { | |
| showingIndicator.toggle() | |
| } label: { | |
| Text("Show or Hide Indicator") | |
| .foregroundColor(Color.white) | |
| .padding() | |
| .background(Color.gray) | |
| .clipped() | |
| } | |
| } | |
| if showingIndicator { | |
| ProgressView() | |
| .progressViewStyle(.circular) | |
| .padding(12) | |
| .tint(Color.white) | |
| .background(Color.gray.opacity(0.6)) | |
| .cornerRadius(8) | |
| .scaleEffect(1.6) | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment