I tried removing several Text views in List as the mode transited to Edit but the List kept a row height before transition and the row height changed after scrolling. I would like to change the row height as the mode transited to Edit. How can I actualize it?
The following code is to see the problem.
Xcode 12.4
iOS 14.4
The following code is to see the problem.
Xcode 12.4
iOS 14.4
Code Block SwiftUI import SwiftUI struct ContentView: View { @Environment(\.editMode) var editMode @State private var selections: Set<Int> = Set() var body: some View { VStack { EditButton() List(selection: self.$selections) { ForEach(0..<100) { i in VStack { Text("First Text") if editMode?.wrappedValue != .active { Text("Second Text") Text("Third Text") Text("Forth Text") Text("Fifth Text") Text("Sixth Text") } } } } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }