gpt4 book ai didi

ios - 如何使用 Eureka 制作两个互斥的分段行

转载 作者:行者123 更新时间:2023-12-01 16:09:04 25 4
gpt4 key购买 nike

我用 Eureka library我想用这段代码制作两个互斥的分段行:

        <<< SegmentedRow<String>("weight1") { row in
row.options = ["До 3 кг", "До 5 кг"]
row.value = "До 3 кг"
}.onChange{ [weak self] row in
let weight2Row: SegmentedRow<String>! = self?.form.rowByTag("weight2")
weight2Row.value = nil
}

<<< SegmentedRow<String>("weight2") { row in
row.options = ["До 16 кг", "У меня авто"]
}.onChange{ [weak self] row in
let weight1Row: SegmentedRow<String>! = self?.form.rowByTag("weight1")
weight1Row.value = nil
}

但是如果我点击第二个分段行,第一个分段控件不会清理选择

enter image description here

最佳答案

如指南中所述 - How to set the form values using a dictionary 部分

If the form was already displayed we have to reload the visible rows either by reloading the table view tableView.reloadData() or invoking updateCell() to each visible row.



所以只需调用 weight2Row.updateCell()反射(reflect)新的值(value)观。

关于ios - 如何使用 Eureka 制作两个互斥的分段行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38140538/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com