Closed gorbat-o closed 8 years ago
Do the same but using cellUpdate
instead of cellSetup
.
Example code:
<<< ActionSheetRow<String>() {
...
}
.cellUpdate({ (cell, row) in
cell.detailTextLabel?.layer.cornerRadius = 20
cell.detailTextLabel?.clipsToBounds = true
cell.detailTextLabel?.layer.backgroundColor = UIColor.greenColor().CGColor
})
Hey,
Thanks for anwser, i just try that with
// Setting menuTitles
for menuTitle in menuTitles {
form.last! <<< LabelRow(menuTitle) {
$0.title = $0.tag
$0.value = "1"
} .onCellSelection { cell, row in
debugPrint("Click on \(menuTitle)")
} .cellSetup { cell, row in
print("cellSetup called")
cell.detailTextLabel?.textColor = UIColor.whiteColor()
cell.detailTextLabel?.layer.backgroundColor = UIColor.redColor().CGColor
} .cellUpdate { cell, row in
print("cellUpdate called")
cell.detailTextLabel?.layer.cornerRadius = 20
cell.detailTextLabel?.clipsToBounds = true
}
}
and it's change nothing :/
Put all the code into cellUpdate as my example shows
Thanks for fast answer I have already do it
// Setting menuTitles
for menuTitle in menuTitles {
form.last! <<< LabelRow(menuTitle) {
$0.title = $0.tag
$0.value = "1"
} .onCellSelection { cell, row in
debugPrint("Click on \(menuTitle)")
} .cellSetup { cell, row in
print("cellSetup called")
} .cellUpdate { cell, row in
print("cellUpdate called")
cell.detailTextLabel?.textColor = UIColor.whiteColor()
cell.detailTextLabel?.layer.backgroundColor = UIColor.redColor().CGColor
cell.detailTextLabel?.layer.cornerRadius = 20
cell.detailTextLabel?.clipsToBounds = true
}
}
after that, it's change nothing :/
This is my code...
<<< LabelRow() {
$0.title = "LabelRow"
$0.value = "1"
} .onCellSelection { cell, row in
} .cellSetup { cell, row in
print("cellSetup called")
} .cellUpdate { cell, row in
print("cellUpdate called")
cell.detailTextLabel?.textColor = UIColor.whiteColor()
cell.detailTextLabel?.layer.backgroundColor = UIColor.redColor().CGColor
//cell.detailTextLabel?.layer.cornerRadius = 20
//cell.detailTextLabel?.clipsToBounds = true
}
and this is the result...
LabelRow cell is nothing else than a UITableViewCell so the flexibility to make customizations over it is limited by UIKit if exists. Eureka does not change any cell subview frame neither its constraints.
I will close the issue since this is not related directly with Eureka.
It's up to you to create a custom row adding the view that you need.
Thanks 👍
Eureka (last) Xcode (last) iOS version (last)
Hi,
(sorry for bad english) I'm trying to resize the frame of detailTextLabel, and apply a cornerRadius on it. But it makes nothing.
i'have tried everything under this line ..
Thanks for futur help 👍
Cordially,