Skip to content

Instantly share code, notes, and snippets.

@takoikatakotako
Created October 23, 2024 12:46
Show Gist options
  • Select an option

  • Save takoikatakotako/5f3c8d7835e583005dc4aaa45abcbc59 to your computer and use it in GitHub Desktop.

Select an option

Save takoikatakotako/5f3c8d7835e583005dc4aaa45abcbc59 to your computer and use it in GitHub Desktop.
SwiftUIで少しカスタマイズしたインディケーターを表示する
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