0

我正在根据 API 调用的响应创建一个表单,因此该表单是在 API 请求的完成块中创建的。

这样做会导致表单“反弹”。如果我刷新 API 调用以获取新值并重建表单,它会“反弹”然后“反弹”回来。

示例 GIF

有没有办法禁用这个弹跳动画?

4

1 回答 1

1

使用 form = Section() 而不是 form +++ Section

class ViewController: FormViewController {

override func viewDidLoad() {
    super.viewDidLoad()

    form = Section("Section1")
        <<< TextRow() { row in
            row.title = "Text Row"
            row.placeholder = "Enter text here"
        }
        <<< PhoneRow() {
            $0.title = "Phone Row"
            $0.placeholder = "Add numbers here"
        }
    +++ Section("Section2")
        <<< DateRow() {
            $0.title = "Date Row"
            $0.value = Date(timeIntervalSinceReferenceDate: 0)
        }
}

来源:https://github.com/xmartlabs/Eureka/issues/575

于 2016-12-21T14:52:17.413 回答