iOS:Eureka表单。如何从PickerInputRow更改Picker上的色调

时间:2017-07-27 03:05:52

标签: ios swift3 eureka-forms

范围

  • iOS:10.0
  • Eureka:3.0

如何在例如:MultipleSelectorRow<T>上配置所呈现视图的属性?

代码

在Example项目中,这里有一个MultipleSelectorRow

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

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

MultipleSelectorRow present tint

1 个答案:

答案 0 :(得分:0)

解决方案是在onPresent回调中配置显示的VC。可以配置更多的东西,只需要深入到课程中。

配置

只需以与selectableRowCellSetup

类似的方式定义[cellSetup][1]
...
.onPresent { from, to in
  to.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: from, action: #selector(RowsExampleViewController.multipleSelectorDone(_:)))
  to.selectableRowCellSetup = { cell, row in
    cell.tintColor = .red
  }
}
...

结果

enter image description here