Skip to content

Commit

Permalink
Merge pull request #33 from SOPT-all/feat/31-week3
Browse files Browse the repository at this point in the history
[3주차] 김승원 실습
  • Loading branch information
SeungWon1125 authored Dec 3, 2024
2 parents 120a075 + 96b46b3 commit 6be5b3b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SeungWonSU/SeungWonSU/SeungWonSUApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftUI
struct SeungWonSUApp: App {
var body: some Scene {
WindowGroup {
Week2View()
week3View()
}
}
}
64 changes: 64 additions & 0 deletions SeungWonSU/SeungWonSU/week3View.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// week3View.swift
// SeungWonSU
//
// Created by 김승원 on 11/17/24.
//

import SwiftUI

struct week3View: View {
let data = Array(1...30).map { "Minji \($0)"}

let columns = [
GridItem(.flexible()),
GridItem(.flexible()),
GridItem(.flexible())
]

let rows = [
GridItem(.fixed(100)),
]

var body: some View {
VStack(spacing: 0) {
ScrollView {
ScrollView(.horizontal) {
LazyHGrid(rows: rows, spacing: 10) {
ForEach(data, id: \.self) { i in
VStack(spacing: 0) {
Image(.minji)
.resizable()
.scaledToFit()
.cornerRadius(15)
.frame(width: 100, height: 100)
Text(i)
}
}
}
}


LazyVGrid(columns: columns, spacing: 10) {
ForEach(data, id: \.self) { i in
VStack(spacing: 10) {
Image(.minji)
.resizable()
.scaledToFit()
.cornerRadius(15)
Text(i)
}
}
}
.padding(.horizontal)
}
.scrollIndicators(.hidden)
}
}


}

#Preview {
week3View()
}

0 comments on commit 6be5b3b

Please sign in to comment.