Swift-UI-视图
一组可在SwiftUI项目中重用的自定义视图
目录
观看次数
转变
适用于: iOS , macOS , watchOS和tvOS ,并进行了一些修改。
struct CustomSwitch : View {
@Binding var isOn: Bool
var body: some View {
ZStack {
Capsule ()
. foregroundColor (isOn ? Color. green : Color. gray . opacity ( 0.35 ))
. background (Color. clear )
. frame ( width : 100 , height : 50 )