Skip to content

Commit

Permalink
feat: Spacer, Padding 실습
Browse files Browse the repository at this point in the history
  • Loading branch information
sem-git committed Nov 10, 2024
1 parent 00b0e87 commit 54f31ec
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
12 changes: 12 additions & 0 deletions LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
769FAB262CE1157A00785E3D /* SpacerPaddingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 769FAB252CE1157A00785E3D /* SpacerPaddingExample.swift */; };
76BD46112CE103AB00E215FE /* VStackHStackExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76BD46102CE103AB00E215FE /* VStackHStackExample.swift */; };
76BD46132CE103C300E215FE /* ZStackExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76BD46122CE103C300E215FE /* ZStackExample.swift */; };
76BD461B2CE10C9F00E215FE /* ComponentExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76BD461A2CE10C9F00E215FE /* ComponentExample.swift */; };
Expand All @@ -17,6 +18,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
769FAB252CE1157A00785E3D /* SpacerPaddingExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpacerPaddingExample.swift; sourceTree = "<group>"; };
76BD46102CE103AB00E215FE /* VStackHStackExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VStackHStackExample.swift; sourceTree = "<group>"; };
76BD46122CE103C300E215FE /* ZStackExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZStackExample.swift; sourceTree = "<group>"; };
76BD461A2CE10C9F00E215FE /* ComponentExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComponentExample.swift; sourceTree = "<group>"; };
Expand All @@ -38,6 +40,14 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
769FAB242CE1155700785E3D /* SpacerPadding */ = {
isa = PBXGroup;
children = (
769FAB252CE1157A00785E3D /* SpacerPaddingExample.swift */,
);
path = SpacerPadding;
sourceTree = "<group>";
};
76BD46192CE10C8300E215FE /* UIComponent */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -85,6 +95,7 @@
76FC2DD82CE06C37000B329B /* Week2 */ = {
isa = PBXGroup;
children = (
769FAB242CE1155700785E3D /* SpacerPadding */,
76BD46192CE10C8300E215FE /* UIComponent */,
76FC2DD92CE06C4C000B329B /* Stacks */,
);
Expand Down Expand Up @@ -172,6 +183,7 @@
files = (
76DFF9322CD7B4F100C373C3 /* ContentView.swift in Sources */,
76DFF9302CD7B4F100C373C3 /* LeeSeminSUApp.swift in Sources */,
769FAB262CE1157A00785E3D /* SpacerPaddingExample.swift in Sources */,
76BD461B2CE10C9F00E215FE /* ComponentExample.swift in Sources */,
76BD46132CE103C300E215FE /* ZStackExample.swift in Sources */,
76BD46112CE103AB00E215FE /* VStackHStackExample.swift in Sources */,
Expand Down
Binary file not shown.
4 changes: 3 additions & 1 deletion LeeSeminSU/LeeSeminSU/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ struct ContentView: View {
// VStackHStackExample()
// ZStackExampleView()

ComponentExample()
// ComponentExample()

SpacerPaddingExample()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// SpacerPaddingExample.swift
// LeeSeminSU
//
// Created by 이세민 on 11/10/24.
//

import SwiftUI

struct SpacerPaddingExample: View {
var body: some View {
VStack{
Text("Spacer")
.font(.title3)
.padding()

HStack {
Text("왼쪽")
.padding()
.border(.yellow)
Spacer() // Spacer가 왼쪽 뷰와 오른쪽 뷰 사이에 남는 공간을 채움
Text("오른쪽")
.padding()
.border(.yellow)
}
.padding()
.border(.yellow)
}
.padding(.bottom, 100)

Text("Padding")
.font(.title3)
.padding() // 기본 패딩은 모든 방향에 동일한 여백을 추가
.border(.blue)
}
}

0 comments on commit 54f31ec

Please sign in to comment.