开发者

ListView: disabling clicking/focus

开发者 https://www.devze.com 2023-01-27 04:11 出处:网络
I added a header view to my ListView and it\'s working quite well, the problem I\'m having right now is that I need to remove the default clicking/focus effect when I 开发者_JAVA技巧click the header.

I added a header view to my ListView and it's working quite well, the problem I'm having right now is that I need to remove the default clicking/focus effect when I 开发者_JAVA技巧click the header.

Apart from that, is it possible to also remove the click/focus effect to some items when they are "disabled" options?


Of course you can do this! For header or footer views you can just call addHeaderView (View v, Object data, boolean isSelectable) or addFooterView (View v, Object data, boolean isSelectable) respectively with isSelectable == false.

For regular list items you may just return false for the boolean isEnabled (int position) method. :-)


I solved this by just setting the onClickHandler for the header view to null...worked for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号