gpt4 book ai didi

iOS eureka-forms LabelRow 隐藏条件未评估

转载 作者:行者123 更新时间:2023-11-29 11:43:13 24 4
gpt4 key购买 nike

设置

  • swift 3.1
  • iOS 10.0
  • Eureka 3.0

问题

不能使 LabelRowTextAreaRow 隐藏状态一起隐藏。标签是在将两者添加到部分之前定义的。它被添加到文本之上。

代码

在通过几种不同的方式定义Condition 之后,在调试时,函数似乎没有被调用。仅在前 2 个中调用一次,但在 TextAreaRow 更改为隐藏或显示时不会调用

    let switchRowTag = "switchRowTag"
form +++ section
<<< SwitchRow(switchRowTag) { row in
row.title = "Select me"}

// Test hiding functions ========================
let tag = "textArea"
let title = "Test Hiding"
let labelTag = "\(tag)_label"
let textArea = TextAreaRow(tag) {
$0.title = title
$0.tag = tag
$0.placeholder = title
$0.textAreaHeight = .dynamic(initialTextViewHeight: 110)
$0.hidden = Condition.predicate(NSPredicate(format: "$\(switchRowTag) == false"))
}
let labelRow = LabelRow(labelTag) {
$0.title = title
$0.tag = labelTag
/* try setting the function after adding to the section
$0.hidden = Condition.function([tag], { form in
if let textRow = form.rowBy(tag: tag) as? TextAreaRow {
return textRow.isHidden
} else {
return false
}
})
*/
}

section <<< labelRow <<< textArea
// Is never evaluated
/*
labelRow.hidden = Condition.function([tag], { form in
if let textRow = form.rowBy(tag: tag) as? TextAreaRow {
return textRow.isHidden
} else {
return false
}
})
*/
if let labelRow = form.rowBy(tag: labelTag) as? LabelRow {
labelRow.hidden = Condition.function([tag], { form in
if let textRow = form.rowBy(tag: tag) as? TextAreaRow {
return textRow.isHidden
} else {
return false
}
})
}

最佳答案

目前不支持。

Eureka 仅支持重新评估隐藏条件,当标签所依赖的相关行具有仅更改值时。不是可见性的变化 (r ef)。

关于iOS eureka-forms LabelRow 隐藏条件未评估,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45316960/

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