复选框以选择列表视图 [英] Checkbox selection with listview

查看:198
本文介绍了复选框以选择列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  安卓:复选框的选择问题

我想我的选择布局中的所有复选框,当我pressing检查所有按钮。我做了一个列表,并把一个复选框与该列表。

I'm trying to select all my checkboxes in the layout, when I'm pressing 'check all' button. I've done a list and placing a checkbox with that list.

现在,我要选择用按一下按钮布局我所有的复选框。我怎么能继续这样做呢?

Now, I want to select all my checkboxes in the layout using button click. How can I proceed to this?

(注意:我只放置一个复选框,这将在列表中使用列表视图每个项目显示)。

(Important : I'm placing only one checkbox and this will show with every item in list using listview).

推荐答案

三两种可能性。如果您使用的是默认样式意味着listview.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);然后有一个解决方案。

Three are two possibilities. If you are using default style means listview.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); then there is one solution.

如果您使用的是自定义适配器是指在布局中,可以保持两个图像一个正常,一个用于检查再有其他的解决方案。

If you are using custom adapter means in the layout you maintain two images one for normal and one for checked then there is other solution.

如果你按照第一种方式,那么这是解决()...

If you follow first way then this is the solution()...

http://www.ziddu.com/download/16103715/LvCheckBoxes。 zip.html

如果你遵循第二种方式则让我知道。我给那个例子...

If you are followed second way then let me know. I will give that example...

这篇关于复选框以选择列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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