android:clickable = true makes layout not clickable?

by dxw_es » Sat, 10 Jul 2010 02:01:19 GMT


Sponsored Links
 Hey everyone..... I noticed something odd. I have a listview with
custom BaseAdapter, and getView() inflates a layout. On 1.6 SDK (I've
been developing on a G1), if I set android:clickable="true" on the
layout, then the item is NOT clickable (but otherwise the item is
clickable). Is this the correct behavior? It seems backwards to me.

Furthermore, no matter now matter how i set android:clickable for the
same layouts using 2.2 SDK (run using emulator), the layout always is
clickable... eh? I'm really bothered by this.

--



android:clickable = true makes layout not clickable?

by Matt » Sat, 10 Jul 2010 04:58:33 GMT


 How do you know it isn't clickable?  Did you try adding an onClick
listener?

Just because a view is clickable, does NOT mean it will change
background colors when clicked.  You have to use <state> to change the
backgrounds when something is focused, pressed, etc.

-Matt




--


Sponsored Links