自定义DecimalRow文本颜色

时间:2017-03-21 04:37:47

标签: eureka-forms

我正在尝试更改DecimalRow的文本颜色。 cell.textField上的tintColor和textColor属性似乎都没有做任何事情:

<<< DecimalRow(){
    $0.tag = "final";
    $0.useFormatterDuringInput = true
    let formatter = CurrencyFormatter()
    formatter.locale = .current
    formatter.numberStyle = .currency
    $0.formatter = formatter
    }.cellSetup({ (cell, row) in
        cell.textField.textColor = UIColor(red:0.15, green:0.55, blue:0.16, alpha:1.0)
        cell.textField.tintColor = UIColor(red:0.15, green:0.55, blue:0.16, alpha:1.0)
    })

1 个答案:

答案 0 :(得分:0)

尝试使用cellUpdate关闭,它可以正常工作,请看下面的图片

        <<< DecimalRow(){
            $0.tag = "final";
            $0.useFormatterDuringInput = true
            let formatter = CurrencyFormatter()
            formatter.locale = .current
            formatter.numberStyle = .currency
            $0.formatter = formatter
            }.cellUpdate({ (cell, row) in
                cell.textField.textColor = UIColor(red:0.15, green:0.55, blue:0.16, alpha:1.0)
                cell.textField.tintColor = UIColor(red:0.15, green:0.55, blue:0.16, alpha:1.0)
            })

enter image description here

我希望这能帮到你,最好的问候