简体   繁体   English

实现多个微调器的最佳方法是什么?

[英]What is the best way to implement multiple spinners?

I want to know that what will be the best way to implement spinner in a listview. 我想知道在listview中实现微调器的最佳方法是什么。 My scenario is I am getting products names, prices and their number from server side. 我的情况是从服务器端获取产品名称,价格及其编号。 For this I am going to make one main Activity (with one xml) that will contain the listview and a separate adapter class to make the adapter for the listview and that adapter layout. 为此,我将制作一个主活动(带有一个xml),其中将包含列表视图和一个单独的适配器类,以为列表视图和该适配器布局创建适配器。 Now I want to ask is this approach will be good as I will be having some operations on spinner selection (getting each spinner (or product) dropdown number, spinner (or product) name and position) and also I will have to handle spinner positions as getview() will render each time? 现在,我想问一问这种方法是否会很好,因为我将对微调框选择进行一些操作(获取每个微调框(或产品)的下拉编号,微调框(或产品)的名称和位置),而且我还必须处理微调框的位置作为getview()将每次呈现? Or you people suggest me some good ideas instead of this? 还是你们向我建议了一些好主意呢?

Having many spinners in a ListView is possible but I would imagine in most cases it'd be inconvenient for the user -- too much clutter and moving elements on top of each other. ListView中可以有许多微调框,但是我想在大多数情况下,这对于用户来说是不方便的-太多的杂乱和彼此叠加的移动元素。 I suggest you create a separate Fragment for item details, and only display static items in your ListView that will take the user to item details fragment (with spinners and anything else you might need). 我建议您为项目详细信息创建一个单独的Fragment ,并仅在ListView中显示静态项目,该静态项目会将用户带到项目详细信息片段(包括微调器和您可能需要的其他任何内容)。 Take a look at this design pattern: Multi-pane layouts 看看这种设计模式: 多窗格布局

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM