Skip to content
Advertisement

How to change pressed color to other color of selector dynamically?

that’s my selector for list:(item_selector.xml)

JavaScript

that’s my row of list(row_item.xml)

JavaScript

I want to change android:state_pressed=”true” android:drawable=”@color/orange” to other color dynamically. My goal, to make pressed color for each row different. Is it possible to do?

Advertisement

Answer

Affect to each item a new StateListDrawable.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement