Swift预览画布显示

时间:2020-06-10 07:34:53

标签: canvas

我从主页显示详细信息,用户从列表中选择,然后显示在详细信息视图中。但是,我不确定要在Canvas中显示文本字段我需要什么代码预览?

谢谢!!!

import SwiftUI
struct CampDetails: View {

  var campEntry: Stuff
  @State private var campname: String = ""
  var body: some View {
    NavigationView {
      VStack {
        HStack{
          Text("Campsite Name:")
            .font(.custom("Sanfrancisco", size: 20))
            .foregroundColor(Color.orange)
          Spacer()
        }

        //Not used yet
        //  TextField("\(campEntry.campname ?? "No callsign.")", text: $campname)
        Text(campEntry.storeddate!)
      }
      .navigationBarTitle("\(campEntry.campname!)")
    }

  }
}

struct CampDetails_Previews: PreviewProvider {
  static var previews: some View {
    CampDetails()

}

0 个答案:

没有答案