I'm trying to do a blue background with white text for a ButtonRow using:
<<< 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()
}
It just stays the tintColor
Try to set the textColor in the cellUpdate method like this
<<< ButtonRow ("Login") {
$0.title = "Login"
}.cellUpdate { cell, row in
cell.textLabel?.textColor = UIColor.whiteColor()
cell.backgroundColor = UIColor.blueColor()
}
Great, thanks , using cellUpdate instead of cellSetup works.
It's better to use cell's tintColor
property here.
logoutRow = ButtonRow() { row in
row.title = "Logout".localized
row.cell.textLabel?.font = font
row.cell.tintColor = UIColor(rgb: 0xE25564)
}
Most helpful comment
Try to set the textColor in the cellUpdate method like this
<<< ButtonRow ("Login") { $0.title = "Login" }.cellUpdate { cell, row in cell.textLabel?.textColor = UIColor.whiteColor() cell.backgroundColor = UIColor.blueColor() }