如何在列表视图不可点击的Andr​​oid设置项目 [英] how to set an item in a listview not clickable android

查看:104
本文介绍了如何在列表视图不可点击的Andr​​oid设置项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在列表视图中的项目没有点击能。我得到了主题和项目的列表视图,但观点是相同的两个课题和项目。该项目被点击能,但话题是不是点击能。如何实现这一目标。

How to make the items in a list view not click able. i got topics and items in a list view but the view is same for both topics and items. the items are click able but the topic is not click able. how to achieve this

列表会像

Topic
item
Topic
item
item

主题。点击能(假)没有工作,请大家帮忙

topic. click able(false) did not work, please help

推荐答案

分享我的经验,下面做的伎俩(查看指列表项视图):

Sharing my experience, the following did the trick (view refers to the list item view):

view.setEnabled(false);
view.setOnClickListener(null);

  • 使通过重写方法没有奏效的方法决不会被调用。
  • 设置可聚焦为false没有正常工作。
  • 这篇关于如何在列表视图不可点击的Andr​​oid设置项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆