Skip to content

Commit 4851a41

Browse files
authored
Merge pull request Jinxiansen#36 from LikeeCat/master
[Add] spacer to Special Views
2 parents 745fddd + 3f1cb4d commit 4851a41

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

Example/Example.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
41FE99F022AADF9F008135A0 /* DatePickerPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41FE99EF22AADF9F008135A0 /* DatePickerPage.swift */; };
5151
BD99734E23B49BB800A3E3F0 /* FormPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD99734D23B49BB800A3E3F0 /* FormPage.swift */; };
5252
D74985BC231634DA00C4D46D /* Window+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = D74985BB231634DA00C4D46D /* Window+Ext.swift */; };
53+
FC8DE9B929309F3D00A5C8FF /* SpacerPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC8DE9B829309F3D00A5C8FF /* SpacerPage.swift */; };
5354
/* End PBXBuildFile section */
5455

5556
/* Begin PBXFileReference section */
@@ -99,6 +100,7 @@
99100
41FE99EF22AADF9F008135A0 /* DatePickerPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatePickerPage.swift; sourceTree = "<group>"; };
100101
BD99734D23B49BB800A3E3F0 /* FormPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormPage.swift; sourceTree = "<group>"; };
101102
D74985BB231634DA00C4D46D /* Window+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Window+Ext.swift"; sourceTree = "<group>"; };
103+
FC8DE9B829309F3D00A5C8FF /* SpacerPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpacerPage.swift; sourceTree = "<group>"; };
102104
/* End PBXFileReference section */
103105

104106
/* Begin PBXFrameworksBuildPhase section */
@@ -179,6 +181,7 @@
179181
41F36F0D22AA8AEC00B9172D /* WebViewPage.swift */,
180182
4160445022B2987A0052CAFC /* ControllerPage.swift */,
181183
4160444B22B291000052CAFC /* UIKitController.swift */,
184+
FC8DE9B829309F3D00A5C8FF /* SpacerPage.swift */,
182185
);
183186
path = SpecialPage;
184187
sourceTree = "<group>";
@@ -371,6 +374,7 @@
371374
36F7ED9F2465231100CF20CB /* LotteryView.swift in Sources */,
372375
4196ABE722AA268A008B8FD2 /* TextFieldPage.swift in Sources */,
373376
4161B32722AB68F600CD5A1B /* HStackPage.swift in Sources */,
377+
FC8DE9B929309F3D00A5C8FF /* SpacerPage.swift in Sources */,
374378
D74985BC231634DA00C4D46D /* Window+Ext.swift in Sources */,
375379
4164489D22AA6D6500A93AF2 /* ImagePage.swift in Sources */,
376380
4161B32922AB695A00CD5A1B /* VStackPage.swift in Sources */,

Example/Example/ContentView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ struct ContentView : View {
2525
NavigationLink(destination: ControllerPage<UIKitController>()) {
2626
PageRow(title: "UIViewController", subTitle: "打开 UIViewController")
2727
}
28+
NavigationLink(destination: SpacerPage()) {
29+
PageRow(title: "Spacer", subTitle: "一个空白占用视图,为了方便展示,已用黄色标出")
30+
}
2831
}
2932
Section(header: Text("基础控件")) {
3033
NavigationLink(destination: TextPage()) {

Example/Example/Page/Navigation/NavigationViewPage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct NavigationViewPage : View {
2828
}
2929

3030
#if DEBUG
31-
struct SpacerPage_Previews : PreviewProvider {
31+
struct NavigationViewPage_Previews : PreviewProvider {
3232
static var previews: some View {
3333
NavigationViewPage()
3434
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// SpacerPage.swift
3+
// Example
4+
//
5+
// Created by likeecat on 2022/11/25.
6+
// Copyright © 2022 晋先森. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
struct SpacerPage: View {
12+
var body: some View {
13+
VStack{
14+
HStack {
15+
Text("made in China.")
16+
Spacer().frame(height: 20).background(Color.yellow)
17+
Text("the People's Republic Of China.")
18+
}
19+
Divider() // Just add a line.
20+
VStack {
21+
Text("made in China.")
22+
Spacer().frame(width: 20).background(Color.yellow)
23+
Text("the People's Republic Of China.")
24+
}
25+
}
26+
}
27+
}
28+
29+
struct SpacerPage_Previews: PreviewProvider {
30+
static var previews: some View {
31+
SpacerPage()
32+
}
33+
}

0 commit comments

Comments
 (0)