Joost Joost - 3 years ago 180
iOS Question

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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download