簡體   English   中英

當通過 cell.detailTextLabel 添加 Eureka PickerInlineRow 值時,form.values() 顯示初始文本

[英]When Eureka PickerInlineRow value is added via cell.detailTextLabel, form.values() shows initial text

  • 環境:尤里卡:5.2.1 Xcode:11.4 iOS 版本:13.4

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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM