Search code examples
ioslistviewtitaniumappcelerator

Appcelerator ListView transparent row selection?


I've made an app (for iOS) that shows a ListView with product information on it.

On the left of the row, I have a button to add the product to the orderlist. However when I click the button, the entire row changes color. I don't want this, I want the row to stay the same when it is clicked.

I've tried to set the allowSelection property to 'false', but then the 'itemclick' event doesn't fire anymore, so that's not the solution.

I also tried to set the selectedBackgroundColor property to 'transparent', but this still changed the color of the row when the button is clicked.

Is there any easy solution to this? Thanks.


Solution

  • Use "selectionStyle" property of the cell class, example shown below,

    cell.selectionStyle = .none
    

    By this usage the selection will occur but it wont change the color on highlighting(selecting state) of the cell.