Mic*_*ale 4 ios swift3 eureka-forms
我正在使用Swift 3创建一个IOS应用程序并实现Eureka Forms.作为表单的一部分,我有一个用作删除按钮的Button Row.我因此希望将文字颜色改为白色.
我尝试了以下内容,但是单元格文本颜色会引发错误.关于我如何正确实现这一点的任何想法?
+++ Section("Delete Item")
<<< ButtonRow() {
$0.title = "Delete"
}.cellSetup() {cell, row in
cell.backgroundColor = UIColor.red
cell.textLabel?.textColor = UIColor.whiteColor()
}.onCellSelection { cell, row in self.deleteItem() }
Run Code Online (Sandbox Code Playgroud)
你很近,你必须用tintColor而不是textColor,使用这个代码
<<< ButtonRow() {
$0.title = "Delete"
}.cellSetup() {cell, row in
cell.backgroundColor = UIColor.red
cell.tintColor = UIColor.white
}
Run Code Online (Sandbox Code Playgroud)
我希望这可以帮助你
| 归档时间: |
|
| 查看次数: |
1552 次 |
| 最近记录: |