Skip to content

Commit

Permalink
第三节
Browse files Browse the repository at this point in the history
将视觉组件添加到详细信息视图
现在您已经有了细节视图的框架,接下来将添加视觉组件以完成它。完整的详细信息视图将显示Scrum的名称,会议持续时间,名片颜色和与会者列表。
  • Loading branch information
mona-lisa-octo-ue5 committed Jan 6, 2021
1 parent 9777620 commit 3fd8893
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
4 changes: 4 additions & 0 deletions SwiftUIPro/SwiftUIPro.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
64F0C3D125A46077008BE9EA /* MeetingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64F0C3D025A46077008BE9EA /* MeetingView.swift */; };
64F0C3D425A4683D008BE9EA /* CardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64F0C3D325A4683D008BE9EA /* CardView.swift */; };
64F0C3D725A46F91008BE9EA /* ScrumsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64F0C3D625A46F91008BE9EA /* ScrumsView.swift */; };
64F0C3DA25A47428008BE9EA /* DetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64F0C3D925A47428008BE9EA /* DetailView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -40,6 +41,7 @@
64F0C3D025A46077008BE9EA /* MeetingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeetingView.swift; sourceTree = "<group>"; };
64F0C3D325A4683D008BE9EA /* CardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardView.swift; sourceTree = "<group>"; };
64F0C3D625A46F91008BE9EA /* ScrumsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrumsView.swift; sourceTree = "<group>"; };
64F0C3D925A47428008BE9EA /* DetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -78,6 +80,7 @@
64F0C3D025A46077008BE9EA /* MeetingView.swift */,
64F0C3D325A4683D008BE9EA /* CardView.swift */,
64F0C3D625A46F91008BE9EA /* ScrumsView.swift */,
64F0C3D925A47428008BE9EA /* DetailView.swift */,
6458AF2225A445140063BFE0 /* Assets.xcassets */,
6458AF2725A445140063BFE0 /* Info.plist */,
6458AF2425A445140063BFE0 /* Preview Content */,
Expand Down Expand Up @@ -183,6 +186,7 @@
6458AF2125A445120063BFE0 /* ContentView.swift in Sources */,
64F0C3BB25A44BEA008BE9EA /* Color+Codable.swift in Sources */,
64F0C3CE25A45D5D008BE9EA /* SpeechRecognizer.swift in Sources */,
64F0C3DA25A47428008BE9EA /* DetailView.swift in Sources */,
64F0C3D725A46F91008BE9EA /* ScrumsView.swift in Sources */,
6458AF1F25A445120063BFE0 /* SwiftUIProApp.swift in Sources */,
64F0C3CB25A45A37008BE9EA /* ScrumData.swift in Sources */,
Expand Down
Binary file not shown.
25 changes: 25 additions & 0 deletions SwiftUIPro/SwiftUIPro/DetailView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// DetailView.swift
// SwiftUIPro
//
// Created by 石玉龙 on 2021/1/5.
//

import SwiftUI

struct DetailView: View {
let scrum:DailyScrum
var body: some View {
List{
Section(header: Text("Meeting Info")) {

}
}
}
}

struct DetailView_Previews: PreviewProvider {
static var previews: some View {
DetailView(scrum: DailyScrum.data[0])
}
}
2 changes: 1 addition & 1 deletion SwiftUIPro/SwiftUIPro/ScrumsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct ScrumsView: View {
var body: some View {
List{
ForEach(scrums,id:\.title){ scrum in
NavigationLink(destination: Text(scrum.title)){
NavigationLink(destination: DetailView(scrum: scrum)){
CardView(scrum: scrum)
}
.listRowBackground(scrum.color)
Expand Down

0 comments on commit 3fd8893

Please sign in to comment.