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