[英]Weird about cell.detailTextLabel!.text not showing properly (only show after select it)
[英]When Eureka PickerInlineRow value is added via cell.detailTextLabel, form.values() shows initial text
TLDR; 当我尝试从表单中打印值时,文本更改为初始文本
当点击行时,我以编程方式输入数组中的第一项。 这会填充单元格的值,我可以移动到不同的行。
let fruit = ["Apple", "Peach", "Pear"]
<<< PickerInlineRow<String>(){
$0.title = "Fruits"
$0.options = fruit
$0.tag = "pickerTag"
$0.value = "Select your favorite"
}
.onExpandInlineRow({ (cell, inlineRow, row) in
cell.detailTextLabel?.text = fruit[0]
})
当我点击我的“评论”按钮时,我尝试打印出来自pickerRow的响应,但我没有得到单元格中的实际内容我得到了初始文本的响应(即选择你最喜欢的)
<<< ButtonRow("Review") {
$0.title = "Review"
}
.onCellSelection { [weak self] (cell, row) in
self?.printoutValues()
}
在 printoutValues 函数中
let values = form.values()
print("picklerValue: \(values["pickerTag"] as? String)")
如果用户实际上移动了选择器视图,而不是仅仅点击该行然后移动到下一行,则该值将被正确打印。
当用户第一次点击行并保存时,如何填充该行?
谢谢
我相信这只会在较新版本的 Eureka 中停止工作,但无论如何我想通了。
在.onExpandInlineRow
你必须添加inlineRow.value = fruit[0]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.