In iOS 17, when I try to display a form inside a sheet, under certain conditions the section title and button label will have incorrect style.
Here's a minimal code that can reproduce the issue. The platform is iOS 17.0 (21A5303d)
import SwiftUI
struct TestView: View {
var body: some View {
List {
RowView()
}
}
}
struct RowView: View {
@State var showSheet = false
var body: some View {
VStack {
Button("Show Sheet") {
showSheet = true
}
.sheet(isPresented: $showSheet) {
MySheet()
}
}
}
}
struct MySheet: View {
var body: some View {
Form {
Section {
Text("Hello World!")
Button {
// nothing
} label: {
Label("Button", systemImage: "star")
}
} header: {
Label("Section", systemImage: "star")
}
}
}
}
#Preview {
TestView()
}
When I tap the button Show Sheet, the sheet pops out as shown in the screenshot below:
There are 2 incorrect behavior found in this screenshot:
- The section title should have a smaller font size and in gray color.
- The button label's icon shouldn't be dimmed out.
For comparison, the correct result should look like the following screenshot: