Search code examples
ios7uitableviewpixate

Pixate Freestyle table-view-cell:selected pseudo class


I have a UITableView with some custom cells containing a view and some labels. The view must have a different background color when the cell is selected (als some other properties but lat's start with getting the selected pseudo class working).

I am using PixateFreestyle version 2.1.2.

When applying this line of css:

table-view.goals table-view-cell:selected content-view { background-color: blue; }

The view is always blue even when the cell is not selected.

Do I need to set some other properties to get this pseudo class working?


Solution

  • I could be wrong, but I don't think the selected pseudo class can be used in conjunction with children.

    If you just want a different background color on selection, though, why not make your content-view's background transparent, and just do this:

    table-view.goals table-view-cell:selected{ 
      background-color: blue; 
    }
    

    You should see the Pixate-defined background color on selection. It works for me.