[英]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.