File tree Expand file tree Collapse file tree 4 files changed +23
-35
lines changed Expand file tree Collapse file tree 4 files changed +23
-35
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,19 @@ struct ContentView: View {
7
7
8
8
var body : some View {
9
9
10
- // TabView {
11
- //
12
- // StoryListView()
13
- // .tabItem {
14
- // VStack {
15
- // Image(systemName: "book")
16
- // Text("Reader")
17
- // }
18
- // }
19
- // }
20
- VStack {
21
- StoryListView ( )
10
+ TabView {
11
+
12
+ StoryListView ( )
13
+ . tabItem {
14
+ VStack {
15
+ Image ( systemName: " book " )
16
+ . foregroundColor ( . gray)
17
+ Text ( " Reader " )
18
+ . foregroundColor ( . gray)
19
+ }
20
+ }
22
21
}
23
-
22
+ . preferredColorScheme ( . light )
24
23
}
25
24
}
26
25
Original file line number Diff line number Diff line change @@ -9,14 +9,16 @@ struct StoryListContentView: View {
9
9
var body : some View {
10
10
11
11
VStack {
12
-
13
- VStack { }
14
- . frame ( height: 300 )
15
12
16
13
ForEach ( viewModel. stories) { story in
17
14
18
15
StoryListCell ( viewModel: story)
19
16
}
17
+
18
+ ForEach ( viewModel. stories) { story in
19
+
20
+ StoryListCell ( viewModel: story)
21
+ }
20
22
} . padding ( )
21
23
}
22
24
}
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ struct StoryListHeaderOverlay: View {
10
10
11
11
VStack ( alignment: . center) {
12
12
13
+ Spacer ( )
14
+
13
15
ZStack {
14
16
15
17
Rectangle ( )
@@ -23,6 +25,8 @@ struct StoryListHeaderOverlay: View {
23
25
. font ( . system( size: 32 , weight: . semibold, design: . serif) )
24
26
. frame ( maxWidth: . infinity)
25
27
}
28
+
29
+ Spacer ( )
26
30
}
27
31
}
28
32
}
Original file line number Diff line number Diff line change @@ -13,31 +13,15 @@ struct StoryListView: View {
13
13
ScrollViewReactiveHeader ( header: {
14
14
15
15
HeaderView ( )
16
+ . frame ( height: 300 )
16
17
} , headerOverlay: {
17
18
18
19
StoryListHeaderOverlay ( header: viewModel. header)
20
+ . frame ( height: 300 )
19
21
} , body: {
20
22
21
23
StoryListContentView ( viewModel: viewModel)
22
24
} )
23
-
24
- // ScrollView {
25
- //
26
- // VStack {
27
- //
28
- // HeaderView()
29
- // .background(GeometryReaderOverlay())
30
- //
31
- // StoryListHeaderOverlay(header: viewModel.header)
32
- //
33
- // StoryListContentView(viewModel: viewModel)
34
- //
35
- // }
36
- // }
37
- // .onPreferenceChange(ScrollViewHeaderKey.self) { preferenceData in
38
- //
39
- // print(preferenceData.rect.height)
40
- // }
41
25
}
42
26
}
43
27
@@ -51,7 +35,6 @@ struct HeaderView: View {
51
35
. resizable ( )
52
36
. aspectRatio ( contentMode: . fill)
53
37
. opacity ( 0.35 )
54
- . frame ( height: 300 )
55
38
}
56
39
}
57
40
You can’t perform that action at this time.
0 commit comments