Android部分版本ListView点击Cell时,pressed事件下发给了子元素

如果子元素恰好有 pressed的selector,会导致跟着一起联动,比较不美观。

解决方法:在出问题子元素的所有layout父容器上,加上clickable=true

参考资料:

http://stackoverflow.com/questions/11474247/list-item-click-triggering-child-views-selector

http://stackoverflow.com/questions/2607698/click-in-a-listview-item-changes-status-of-elements-inside-the-item

 

Leave a Reply

Your email address will not be published. Required fields are marked *