自定义形状,

This commit is contained in:
2024-01-30 18:06:53 +08:00
parent 5109b242a6
commit 073ff4aa68
11 changed files with 194 additions and 153 deletions

View File

@@ -26,7 +26,6 @@ struct HomeView: View {
}
.frame(maxWidth: .infinity)
.padding(.horizontal, 12)
.background(Color.gray.opacity(0.2))
}
var Search: some View {
@@ -48,17 +47,17 @@ struct HomeView: View {
Image(systemName: "bell")
.resizable()
.frame(width: 24, height: 24)
.overlay(alignment: .topTrailing) {
.overlay(
Circle()
.fill(Color.red.opacity(0.8))
.frame(width: 20, height: 20)
.overlay {
.overlay(
Text("20")
.foregroundColor(Color.white)
.font(.system(size: 12))
}
)
.offset(x: 8, y: -10)
}
)
Spacer()
}
@@ -243,14 +242,14 @@ struct HomeView: View {
Image("Images/LaunchScreen")
.resizable(resizingMode: /*@START_MENU_TOKEN@*/ .stretch/*@END_MENU_TOKEN@*/)
.frame(maxWidth: 120, maxHeight: 150)
.overlay(alignment: .bottom) {
.overlay(
Text("剩余100")
.font(.system(size: 14))
.foregroundColor(Color.white)
.frame(maxWidth: .infinity)
.padding(.vertical, 4)
.background(Color.red.opacity(0.5))
}
)
.cornerRadius(8)
VStack {
Text("石床垫:阿特伍德黑暗就故事(有的人说啥就是啥呢有的人说啥就是啥呢有的人说啥就是啥呢)")