Hey I wanted to build a flash card like this one:
Until now I was able to do this, this is the code:
struct categoryImageview: View {
let category: MainInformation.Category
var body: some View{
ZStack(alignment:.bottom) {
Image("\(category.rawValue)")
.resizable()
.aspectRatio(contentMode:.fit)
.cornerRadius(20)
.frame(width: 380,height: 300)
VStack {
Rectangle()
.foregroundColor(.black.opacity(0.2))
.background(.ultraThinMaterial)
.cornerRadiusSpecific(radius: 20, corners: [.bottomLeft,.bottomRight])
.frame(width: 380, height: 80)
.overlay {
HStack {
Text("\(category.rawValue)")
.foregroundColor(.white)
.font(.system(size: 35))
.padding(.horizontal,10)
Spacer()
}
}
}
}
}
}
Anyone knows a better way to build it.