次を使用して、ButtonRowの白いテキストで青い背景を作成しようとしています。
<<< ButtonRow("Login") {
$0.title = "Login"
}.onCellSelection({[weak self] row in
self!.handleLogin()
}).cellSetup { cell, row in
cell.textLabel?.textColor = UIColor.whiteColor()
cell.backgroundColor = UIColor.blueColor()
}
それはtintColorのままです
次のようにcellUpdateメソッドでtextColorを設定してみてください
<<< ButtonRow ("Login") {
$0.title = "Login"
}.cellUpdate { cell, row in
cell.textLabel?.textColor = UIColor.whiteColor()
cell.backgroundColor = UIColor.blueColor()
}
よろしくお願いします。cellSetupの代わりにcellUpdateを使用すると機能します。
ここでは、セルのtintColor
プロパティを使用することをお勧めします。
logoutRow = ButtonRow() { row in
row.title = "Logout".localized
row.cell.textLabel?.font = font
row.cell.tintColor = UIColor(rgb: 0xE25564)
}
最も参考になるコメント
次のようにcellUpdateメソッドでtextColorを設定してみてください
<<< ButtonRow ("Login") { $0.title = "Login" }.cellUpdate { cell, row in cell.textLabel?.textColor = UIColor.whiteColor() cell.backgroundColor = UIColor.blueColor() }