Swiftui Form View jump up bug

前端 未结 2 1262
不知归路
不知归路 2021-01-17 19:47

I had a problem when following Raywenderlich Tutorial. The form view will automatically jump upward a little bit every time i clicked an item. Is this a bug

相关标签:
2条回答
  • 2021-01-17 20:26

    If you use a Section Inside of a form, the jumping bug is gone. If you use empty header and footer of a section, it should be look like you do it.

    Form{
           Section(header: Text(""), footer: Text(""), content: {
               Text(...)
               Toggle(...)
           })
        }
    
    0 讨论(0)
  • 2021-01-17 20:34

    Workaround

    By my findings it looks like Form layout issue, thus as a temporary solution the following workaround someone might find applicable:

    Form {
        TextField("Name", text:$task.name)
        Toggle("Completed", isOn: $task.completed)
    }
    .navigationBarTitle("", displayMode: .inline) // !!!
    
    0 讨论(0)
提交回复
热议问题