页面uodate
This commit is contained in:
29
demo/Components/RadioButton.swift
Normal file
29
demo/Components/RadioButton.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// RadioButton.swift
|
||||
// demo
|
||||
//
|
||||
// Created by Jason on 2024/1/26.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct RadioButton: View {
|
||||
@Binding public var checked: Bool
|
||||
var label: String = ""
|
||||
var labelSize: Double = 14
|
||||
var radioSize: Double = 18
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 4, content: {
|
||||
Image(systemName: checked ? "checkmark.circle.fill" : "circle")
|
||||
.resizable()
|
||||
.frame(width: radioSize, height: radioSize)
|
||||
.foregroundColor(checked ? Color.orange : Color.gray)
|
||||
Text(label)
|
||||
.font(.system(size: labelSize))
|
||||
})
|
||||
.onTapGesture {
|
||||
checked.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user