1

I have a question about List Row Dynamic in SwiftUI; how reset height of row when EditMode of List changed, For now, ui element of Row has changed, but height of row in the list not update to fit.

inactive editmode

active editmode

anyone know how to fix it? thanks

1
  • Would you provide related code? Commented Jan 18, 2021 at 4:38

1 Answer 1

4

Use .fixedSize. Example

List {
    ForEach(users, id: \.self) { user in
        //Your list row view
          .fixedSize(horizontal: false, vertical: true) // <-- Here
    }
    .onDelete(perform: delete)
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.