I solved this problem.
Actually Form support scrollClipDisabled !
The problem is that Form will not clip the content after setting the scrollClipDisabled, but the NavigationStack will still clip it.
So we need to add a padding to the Form to give it space to display the shadow.
Here is the correct demo.
NavigationStack {
Form {
Section {
Picker("播放速度", selection: $playSpeed) {
ForEach(speeds, id: \.self) { speed in
Text(String(speed))
}
}
Picker("最高画质", selection: $mediaQuality) {
ForEach(MediaQualityEnum.allCases, id: \.self) { speed in
Text(speed.desp)
}
}
Toggle("Hevc优先", isOn: $preferHevc)
Toggle("无损音频和杜比全景声", isOn: $losslessAudio)
} header: {
Text("播放器")
}
}
.padding(.leading, 60.0) // add this
.scrollClipDisabled() // will work
}
Post
Replies
Boosts
Views
Activity
var body: some View {
NavigationStack {
Form {
Section {
Picker("播放速度", selection: $playSpeed) {
ForEach(speeds, id: \.self) { speed in
Text(String(speed))
}
}
} header: {
Text("播放器")
}
}
.scrollClipDisabled()
}
}