Looking at the following subview, you can see that it extends to the full width of the screen and takes the notch into account, which is great.
struct EventSubtitleView: View {
let model: EventSubtitleViewModel
var body: some View {
Text(model.subtitle)
.frame(maxWidth: .infinity, alignment: .leading)
.font(.subheadline)
.padding()
.background(ColorPanel.oceanBlue.color)
.foregroundColor(ColorPanel.lightCream.color)
}
}
Using this view as a subview in a larger scene looks great too. But this scene has an issue with text clipping at the bottom.
struct EventDetailView: View {
let model: EventDetailViewModel
var body: some View {
ZStack(alignment: .top) {
ColorPanel.lightCream.color
.ignoresSafeArea()
VStack(spacing: 0) {
EventTitleView(title: model.title)
EventSubtitleView(model: model.subtitleViewModel)
EventMessageView(message: model.message)
}
}
}
}
So if I introduce a scroll view that fixes the issue. But now my blue subview no longer extends to the edges of the screen.
struct EventDetailView: View {
let model: EventDetailViewModel
var body: some View {
ZStack(alignment: .top) {
ColorPanel.lightCream.color
.ignoresSafeArea()
ScrollView {
VStack(spacing: 0) {
EventTitleView(title: model.title)
EventSubtitleView(model: model.subtitleViewModel)
EventMessageView(message: model.message)
}
}
}
}
}
How do I get the blue view to extend to the edges of the screen in a scroll view?

