spacing on shapes and text
This commit is contained in:
@@ -25,7 +25,16 @@ enum BGShape: Int, CaseIterable {
|
||||
minHeight: 5,
|
||||
maxHeight: 500,
|
||||
alignment: .center)
|
||||
|
||||
.overlay(
|
||||
text
|
||||
.font(.title2)
|
||||
.fontWeight(.bold)
|
||||
.lineLimit(1)
|
||||
.foregroundColor(textColor)
|
||||
.minimumScaleFactor(0.2)
|
||||
.padding(10)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
)
|
||||
case .diamond:
|
||||
Diamond()
|
||||
.fill(bgColor)
|
||||
@@ -34,7 +43,16 @@ enum BGShape: Int, CaseIterable {
|
||||
minHeight: 5,
|
||||
maxHeight: 500)
|
||||
.aspectRatio(contentMode: .fit)
|
||||
|
||||
.overlay(
|
||||
text
|
||||
.font(.title2)
|
||||
.fontWeight(.bold)
|
||||
.lineLimit(1)
|
||||
.foregroundColor(textColor)
|
||||
.minimumScaleFactor(0.2)
|
||||
.padding(10)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
)
|
||||
case .rectangle:
|
||||
Rectangle()
|
||||
.fill(bgColor)
|
||||
@@ -43,6 +61,16 @@ enum BGShape: Int, CaseIterable {
|
||||
minHeight: 5,
|
||||
maxHeight: 500,
|
||||
alignment: .center)
|
||||
.overlay(
|
||||
text
|
||||
.font(.title2)
|
||||
.fontWeight(.bold)
|
||||
.lineLimit(1)
|
||||
.foregroundColor(textColor)
|
||||
.minimumScaleFactor(0.2)
|
||||
.padding(10)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
)
|
||||
case .roundedRectangle:
|
||||
RoundedRectangle(cornerRadius: 8, style: .continuous)
|
||||
.fill(bgColor)
|
||||
@@ -51,15 +79,17 @@ enum BGShape: Int, CaseIterable {
|
||||
minHeight: 5,
|
||||
maxHeight: 500,
|
||||
alignment: .center)
|
||||
.overlay(
|
||||
text
|
||||
.font(.title2)
|
||||
.fontWeight(.bold)
|
||||
.lineLimit(1)
|
||||
.foregroundColor(textColor)
|
||||
.minimumScaleFactor(0.2)
|
||||
.padding(10)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
)
|
||||
}
|
||||
text
|
||||
.font(.title2)
|
||||
.fontWeight(.bold)
|
||||
.lineLimit(1)
|
||||
.foregroundColor(textColor)
|
||||
.minimumScaleFactor(0.7)
|
||||
.padding(10)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user