Swift - WatchKit: How to set background color for selected row on watch tables? thanks in advance
Asked
Active
Viewed 81 times
1 Answers
1
Make the background as Group
@IBOutlet weak var cellBackGroup: WKInterfaceGroup!
Then set
row.cellBackGroup.setBackgroundColor(UIColor.red)
You can keep a variable
var selectedIndex = 0
and implement delegate method
func table(_ table: WKInterfaceTable, didSelectRowAt rowIndex: Int) {
selectedIndex = rowIndex
....
}

Shehata Gamal
- 98,760
- 8
- 65
- 87
-
Ok thanks, I know but how can I set color to only a cell that I select it? – Reza Kashkoul Jan 26 '22 at 10:35
-
se edit.......... – Shehata Gamal Jan 26 '22 at 10:48
-
Thanks; I made it, by help of you :) – Reza Kashkoul Jan 26 '22 at 11:13
-
@RezaKashkoul you may accept answer if helped – Shehata Gamal Jan 26 '22 at 11:17