Be Smart


SmartPhone - iPhone, iPad, Android

My Links

Blog Stats


[Android 問題] How to Add a Button in ListView, and Make the Event of onClick and onItemClick Coexist?

If you add a Button on the view of each item in ListView,

the touch event is catched and reacted by the button instead of the ListView even outside the area of the Button.

The item can not be selected and switched.

It's a simplest solution that you can set the attribute android:focusable to be false to fix it as showed below:


posted on 2011-03-23 09:57 FANTAISIE 阅读(...) 评论(...) 编辑 收藏