Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List item with button not clickable anymore

Tags:

I have a list item with a button inside.

When the button is shown, the list item is not clickable anymore. To make it clickable again, I have replaced the button with a view. The problem is that, when the list item is clicked, the button changes background image (like if it is clicked). How can avoid this bad behaviour?

Thanks

like image 837
Matroska Avatar asked Jun 22 '12 16:06

Matroska


People also ask

How do I make a list view clickable?

Find the array for the field you want to display as a link (e.g. custom_link_c ). Add 'type'=>'name', and 'link'=>true, to the array for the field, which will override the stock field's vardef and make the field clickable.

Why are my buttons not clickable in html?

A disabled button is unusable and un-clickable. The disabled attribute can be set to keep a user from clicking on the button until some other condition has been met (like selecting a checkbox, etc.). Then, a JavaScript could remove the disabled value, and make the button clickable again.


1 Answers

Set the following properties for you button

  android:focusable="false"
  android:focusableInTouchMode="false"

For ImageButton, also add the following to the parent view

  android:descendantFocusability="blocksDescendants" 
like image 196
vintuwei Avatar answered Oct 14 '22 02:10

vintuwei