05:Swift-Button

 

 

正文

import SwiftUI

struct ButtonPage: View {
    var body: some View {
        Button {
            // 按钮点击事件
            print("按钮点击事件")
        } label: {
            Text("按钮")
                .bold()
                .font(.system(size: 18, weight: .light, design: .rounded))
        }
        .navigationBarTitle(Text("Button")) // 导航标题
        
    }
}

#if DEBUG
struct ButtonPage_Previews : PreviewProvider {
    static var previews: some View {
        ButtonPage()
    }
}
#endif

 

posted on 2023-03-20 19:35  风zk  阅读(17)  评论(0编辑  收藏  举报

导航