13:SwiftUI-slider滑块

 

 

正文

//
//  SliderPage.swift
//  SwiftUIDeom
//
//  Created by zhoukang03 on 2023/3/28.
//

import SwiftUI

struct SliderPage: View {
    @State var rating = 0.3
    
    var body: some View {
        VStack {
            Text("滑块:\(rating)")
            Slider(value: $rating)
                .padding(30)
        }.navigationTitle("滑块")
    }
}

#if DEBUG
struct SliderPage_Previews: PreviewProvider {
    static var previews: some View {
        SliderPage()
    }
}

#endif

 

示例图

 

posted on 2023-03-28 11:50  风zk  阅读(124)  评论(0编辑  收藏  举报

导航