pushdeer/ios/PushDeer-iOS/PushDeer/View/Common/CardView.swift
2021-12-27 22:33:27 +08:00

38 lines
736 B
Swift

//
// CardView.swift
// PushDeer
//
// Created by HEXT on 2021/12/26.
//
import SwiftUI
/// View
struct CardView<Content : View> : View {
/// View
@ViewBuilder let contentView: Content
var body: some View {
contentView
.overlay(RoundedRectangle(cornerRadius: 8).stroke())
.foregroundColor(Color.accentColor)
.background(
Color(UIColor.systemBackground)
.cornerRadius(8)
.shadow(
color: Color.black.opacity(0.16),
radius: 6, x: 0, y: 3
)
)
}
}
struct CardView_Previews: PreviewProvider {
static var previews: some View {
CardView {
Text("Hello, World!")
.padding()
}
}
}