test
This commit is contained in:
38
demo/Components/KillCountDown.swift
Normal file
38
demo/Components/KillCountDown.swift
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// KillCountDown.swift
|
||||
// demo
|
||||
//
|
||||
// Created by Jason on 2024/1/24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct KillCountDown: View {
|
||||
var body: some View {
|
||||
HStack(spacing: 6) {
|
||||
number(num: 23)
|
||||
spector
|
||||
number(num: 19)
|
||||
spector
|
||||
number(num: 9)
|
||||
}
|
||||
}
|
||||
|
||||
func number(num: Int) -> some View {
|
||||
var s = String(num)
|
||||
if num < 10 {
|
||||
s = "0".appending(s)
|
||||
}
|
||||
return Text(s)
|
||||
.padding(4)
|
||||
.foregroundColor(Color.red)
|
||||
.background(Color.white)
|
||||
.font(.system(size: 14))
|
||||
.cornerRadius(4)
|
||||
}
|
||||
|
||||
var spector: some View {
|
||||
Text(":")
|
||||
.foregroundColor(Color.white)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user