Search code examples
iosuitableviewpixate

Custom color for UITableViewCell


I'm usinge pixate in order to customize my app and I have a little problem. I read the doc and the class for UITableVIew is called table-view-cell. I thought that if I created a class named like this I wouldn't have to manually had the class to the cells ? Am I right ?

My css code :

.table-view-cell {
    background-color: red;
}

Tried this too :

.table-view-cell content-view{
    background-color: red;
}

None of them works .. But if I had classes manually it works just fine.


Solution

  • You can set a globally available style like this:

    table-view-cell{
      background-color: #900;
    }
    

    Or you can put a styleClass attribute on a UITableView and target its children:

    .yourTable table-view-cell{
      background-color:#900;
    }
    

    This works for me.