- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试自定义由 MultipleSelectorRow 呈现的 Controller 背景,但我不能。
<<< MultipleSelectorRow<String>("select") { row in
row.options = values
row.onPresentCallback = { _, to in
let backgroundView = UIView(frame: CGRect(x: 0, y: 0, width: (self.tableView?.bounds.size.width)!, height: (self.tableView?.bounds.size.height)!))
backgroundView.backgroundColor = UIColor.red
to.tableView?.backgroundView = backgroundView
}
}
这不起作用,因为触发回调时 to.tableView 为 nil。
我认为在不修改 Eureka 库的情况下修改 Controller 是不可能的
谢谢
最佳答案
我找到了一个解决方案,我按以下方式将原始的 MultipleSelectorViewController 子类化:
import Foundation
import Eureka
import ChameleonFramework
public class MFAMultipleSelectorViewController<T:Hashable> : MultipleSelectorViewController<T> {
open override func viewDidLoad() {
super.viewDidLoad()
setTableViewBackgroundGradient(FlatMintDark(), FlatMintDark().lighten(byPercentage: 0.05)!)
}
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
cell.backgroundColor = ClearColor()
}
}
open class _MFAMultipleSelectorRow<T: Hashable, Cell: CellType>: GenericMultipleSelectorRow<T, Cell, MFAMultipleSelectorViewController<T>> where Cell: BaseCell, Cell: TypedCellType, Cell.Value == Set<T> {
public required init(tag: String?) {
super.init(tag: tag)
}
}
public final class MFAMultipleSelectorRow<T: Hashable> : _MFAMultipleSelectorRow<T, PushSelectorCell<Set<T>>>, RowType {
public required init(tag: String?) {
super.init(tag: tag)
}
}
关于ios - MultipleSelectorRow 自定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40933783/
我正在尝试自定义由 MultipleSelectorRow 呈现的 Controller 背景,但我不能。 ("select") { row in row.options = values
我正在用 Eureka 做过滤器表单。所以有一个包含所有类别的列表,前面还有一个“全部”单元格。所以我的问题是,当我按下“全部”时,如何立即取消选择所有其他单元格以及如何在单击其他单元格时取消选择“全
我正在使用 Eureka 构建一个表单,其中我们从列表中选择多个值,并且我们需要显示在表单上选择的所有值。我为此使用了 MultipleSelectorRow,但没有选项可以根据内容动态增加单元格的大
这是一个与名为 Eureka 的 Swift 开源项目相关的问题。并且我在 SO 上发布了这个问题,因为他们在这里监视他们的标签。 我创建了一个表单,其中有一个 MultipleSelectorRow
我有以下代码: form.last! () { $0.title = field.question $0.options = []
我的用例描述了用户可以在其中选择从 A 到 F 的多个阶段的字段的必要性。为了实现这一点,我使用了 MultipleSelectorRow n Eureka 库: ("phase") {
谁能帮我从 Eureka 表单的 MultipleSelectorRow 中检索值? 我有一个像这样的多选行,其中列出了楼层。 { $0.title = " *Floo
我是一名优秀的程序员,十分优秀!