How to paint a completely gray space with black ? see image
Here is my code:
.onTapGesture {
self.showModal = true
}.sheet(isPresented: self.$showModal, onDismiss: {
// addEntry()
// requestReviewIfNeeded()
self.showModal = false
}, content: {
BiographyDetail(biography: self.biography)
Button(action: {
showModal = false
}) {
Text("CLOSE")
.foregroundColor(.gray)
.background(Color.black).ignoresSafeArea()
}
})
3
Answers
Add frame to
Text
Here is a possible approach – to use color as a background and place specific content into overlay of this color.
Tested with Xcode 13 / iOS 15
Text("CLOSE") .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) .foregroundColor(.gray) .background(Color.black).ignoresSafeArea()