多项选择旋转器

发布于 2024-11-09 11:16:28 字数 87 浏览 4 评论 0原文

我有一个微调器,它的作用就像一个过滤器,用于在多个类别之间进行搜索。但问题是旋转器只允许选择一种类别。有没有办法获得旋转器的多重选择行为,或者存在其他替代方案?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

随心而道 2024-11-16 11:16:28

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?

一场春暖 2024-11-16 11:16:28

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文