iOS:尤里卡形式。如何从 PickerInputRow 更改 Picker 的色调

iOS: Eureka forms. How to change tint on Picker from PickerInputRow

范围

如何配置所显示视图的属性,例如:MultipleSelectorRow<T>?

代码

来自示例项目,这是一个 MultipleSelectorRow

<<< MultipleSelectorRow<Emoji>() {
                        [=11=].title = "MultipleSelectorRow"
                        [=11=].options = [, , , , , ]
                        [=11=].value = [, , ]
                    }.onPresent { from, to in
                        to.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: from, action: #selector(RowsExampleViewController.multipleSelectorDone(_:)))
                    }.cellSetup { cell, row in
                cell.tintColor = .orange
        }

此代码生成一个选择器视图,其中色调是默认的,而不是可以为行的单元格本身设置的任何色调(在本例中,.orange):

解决方案是在 onPresent 回调中配置呈现的 VC。还有更多的东西可以配置,只需要深入研究 类.

配置

用类似于[cellSetup][1]

的方式简单地定义selectableRowCellSetup
...
.onPresent { from, to in
  to.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: from, action: #selector(RowsExampleViewController.multipleSelectorDone(_:)))
  to.selectableRowCellSetup = { cell, row in
    cell.tintColor = .red
  }
}
...

结果