Post

Replies

Boosts

Views

Activity

Reply to scrollClipDisabled not support Form
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 }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’23
Reply to Debug Failed in Xcode Simulator
I upgraded my system to 15.4 beta2 today and the problem was solved.
Replies
Boosts
Views
Activity
Mar ’25
Reply to scrollClipDisabled not support Form
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 }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to scrollClipDisabled not support Form
var body: some View { NavigationStack { Form { Section { Picker("播放速度", selection: $playSpeed) { ForEach(speeds, id: \.self) { speed in Text(String(speed)) } } } header: { Text("播放器") } } .scrollClipDisabled() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23