-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…dView`を適用した
- Loading branch information
1 parent
da4f736
commit 06395b9
Showing
3 changed files
with
61 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// cardView_model.swift | ||
// 1weekPDCA | ||
// | ||
// Created by 齊藤虎太郎 on 2023/02/14. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
struct CardView<Content: View>: View { | ||
let content: Content | ||
|
||
init(@ViewBuilder content: () -> Content) { | ||
self.content = content() | ||
} | ||
|
||
var body: some View { | ||
ZStack { | ||
VStack(spacing: 20) { | ||
Spacer().frame(height: 7) | ||
content | ||
} | ||
.padding(Edge.Set.horizontal, 50) | ||
.background( | ||
GeometryReader { geometry in | ||
Rectangle() | ||
.fill(Color.cardColorGray) | ||
.cornerRadius(25) | ||
.padding(Edge.Set.horizontal, 25) | ||
.frame(height: geometry.size.height + 20) | ||
} | ||
) | ||
} | ||
.frame(height: 120) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters