Eureka: How can I change the text color in ButtonRow?

Created on 17 Jul 2016  路  3Comments  路  Source: xmartlabs/Eureka

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()
                }

screen shot 2016-07-16 at 4 42 17 pm
It just stays the tintColor

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() }

All 3 comments

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) 
}
Was this page helpful?
0 / 5 - 0 ratings