自定义 DecimalRow 文本颜色
Customizing DecimalRow Text Color
我正在尝试更改 DecimalRow 的文本颜色。 cell.textField 上的 tintColor 和 textColor 属性似乎都没有做任何事情:
<<< DecimalRow(){
[=10=].tag = "final";
[=10=].useFormatterDuringInput = true
let formatter = CurrencyFormatter()
formatter.locale = .current
formatter.numberStyle = .currency
[=10=].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)
})
试试用 cellUpdate
闭包代替,它有效,请看下面的图片
<<< DecimalRow(){
[=10=].tag = "final";
[=10=].useFormatterDuringInput = true
let formatter = CurrencyFormatter()
formatter.locale = .current
formatter.numberStyle = .currency
[=10=].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)
})
希望对您有所帮助,祝好
我正在尝试更改 DecimalRow 的文本颜色。 cell.textField 上的 tintColor 和 textColor 属性似乎都没有做任何事情:
<<< DecimalRow(){
[=10=].tag = "final";
[=10=].useFormatterDuringInput = true
let formatter = CurrencyFormatter()
formatter.locale = .current
formatter.numberStyle = .currency
[=10=].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)
})
试试用 cellUpdate
闭包代替,它有效,请看下面的图片
<<< DecimalRow(){
[=10=].tag = "final";
[=10=].useFormatterDuringInput = true
let formatter = CurrencyFormatter()
formatter.locale = .current
formatter.numberStyle = .currency
[=10=].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)
})
希望对您有所帮助,祝好