多项选择旋转器
我有一个微调器,它的作用就像一个过滤器,用于在多个类别之间进行搜索。但问题是旋转器只允许选择一种类别。有没有办法获得旋转器的多重选择行为,或者存在其他替代方案?
I have a spinner that acts like a filter for searching among several categories. But the problem is that the spinner allows only one category to select from. Is there a way to obtain a multiple selection behavior for the spinner, or what other alternatives exists?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
S 微调器旨在一次显示一项。您可能会通过制作一个复选框旋转器来逃脱,但这可能会是一种糟糕的用户体验。
我建议您使用 ListView 代替 CHOICE_MODE_MULTIPLE。您可以将列表视图添加到对话框中,如本答案所示: 是否可以在对话框内创建列表视图?
S spinner is designed to show one item at a time. You might get away by making a spinner of checkboxes, but it will be probably an awful user experience.
I would suggest you a ListView instead and CHOICE_MODE_MULTIPLE. You can add a listview to a dialog as shown in this answer: is it possible to create listview inside dialog?
Android 提供了 Spinner 小部件,其功能类似于下拉列表。但 Spinner 接受单一选择。所以我们一次只选择一项。所以我们可以使用带有多选列表的自定义弹出窗口来实现多选功能。
弹出窗口与对话框类似,只是弹出窗口可以定位。
单击下拉按钮时,将显示一个列表(作为下拉列表),然后您可以选择多个值。选定的值将显示在列表上方的文本框中。
作为参考,您可以更喜欢此链接:
http://asnehal .wordpress.com/2012/04/03/multi-select-drop-down-list-in-android/
Android provides Spinner widget which has functionality similar to drop-down list. But Spinner accepts single selection. so we select only one item at a time.so We can achieve multi-select feature using a custom Pop-up Window with a multi-select list.
Pop-up window is similar to Dialogs except that a pop-up window can be positioned.
When the drop-down button is clicked a list will be displayed(as drop-down), then you can select multiple values. The selected values will be displayed in a Text box above the list.
for reference you can prefer this link:
http://asnehal.wordpress.com/2012/04/03/multi-select-drop-down-list-in-android/