[img]https://i.sstatic. net/xxtf8fiI.png[/img]
Код: Выделить всё
struct SpeedometerView: View {
var body: some View {
ZStack {
Color.black.edgesIgnoringSafeArea(.all)
speedProgressView(width: 300)
}
}
private func speedProgressView(width: CGFloat) -> some View {
ZStack {
Circle()
.trim(from: 0, to: 0.2)
.stroke(.red, style: StrokeStyle(lineWidth: 4, lineCap: .round))
.shadow(color: .green, radius: 10, x: 0, y: 0)
.shadow(color: .green, radius: 2, x: 0, y: 0)
}
.frame(width: width)
.rotationEffect(.degrees(100))
}
}
#Preview {
SpeedometerView()
}
Любая помощь приветствуется.
Подробнее здесь: https://stackoverflow.com/questions/787 ... in-swiftui
Мобильная версия