作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
不能使 LabelRow
与 TextAreaRow
隐藏状态一起隐藏。标签是在将两者添加到部分之前定义的。它被添加到文本之上。
在通过几种不同的方式定义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/
设置 swift 3.1 iOS 10.0 Eureka 3.0 问题 不能使 LabelRow 与 TextAreaRow 隐藏状态一起隐藏。标签是在将两者添加到部分之前定义的。它被添加到文本之上。
返回到包含以下代码的 View 时,LabelRow $0.title 未更新。 如何让 LabelRow 在从更改全局变量的“推送” View 返回后更新其标题? form +++
我是一名优秀的程序员,十分优秀!