【问题标题】:Item selection not working after adding Button添加按钮后项目选择不起作用
【发布时间】:2012-08-24 11:41:56
【问题描述】:

我正在开发一个使用ListView 作为主界面的android 应用程序。 List 中的每一项都包含TextViewButton。当Button 可见时,项目选择不起作用,当按钮不可见时,项目选择工作没有问题。如果我将按钮更改为ImageView,则不会重现此问题。

当按钮可见时,是否有解决方案使项目选择起作用?

【问题讨论】:

  • 你能添加一些代码让我们看看发生了什么吗?
  • 请向我们展示列表视图以及侦听器/处理程序。

标签: android listview button


【解决方案1】:

我们不能直接为List 项目和Button 设置点击选项。所以我们必须使用自定义适配器。

试试这个例子:http://code.google.com/p/codemobiles/source/browse/CustomListViewDemo/

Click is not working on the Listitem Listview android

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-26
    • 1970-01-01
    • 2017-01-01
    • 1970-01-01
    • 2017-08-05
    • 1970-01-01
    相关资源
    最近更新 更多