Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3주차] 김승원 실습 #33

Open
wants to merge 2 commits into
base: seungwon
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
}