简体   繁体   English

类似于苹果商店的ios过滤器选项(下拉列表)

[英]ios filter options similar to the apple store (dropdown list)

I'm trying to figure out how to make a filter option similar to the apple store's filter options. 我试图弄清楚如何使过滤器选项类似于苹果商店的过滤器选项。 The first thing that came to my mind are dropdownlists similar to websites. 我想到的第一件事是类似于网站的下拉列表。 But it doesn't seem to have it on the objects options in xcode. 但是它似乎在xcode的对象选项上没有。 Was wondering where should I start in order to make that kind of function. 想知道我应该从哪里开始才能实现这种功能。

It's similar to this 与此类似

http://www.insightguides.com/docs/halo-asset-manager/images/apps/berlitz-cruise-2013-ipad-6.jpg http://www.insightguides.com/docs/halo-asset-manager/images/apps/berlitz-cruise-2013-ipad-6.jpg

Unless you guys can recommend something else? 除非你们能推荐其他东西? Looking at this, it seems to me it's just a popover? 看着这个,在我看来这只是一个弹出窗口? If this is so, I am in need of 4 - 5 filters, does that mean I should create 4 - 5 viewcontrollers to popover? 如果是这样,我需要4-5个过滤器,这是否意味着我应该创建4-5个ViewController来弹出? It seems like a lot of space is being used just for filters, not really sure how to dynamically generate it using just 1 viewcontroller. 似乎很多空间仅用于过滤器,还不确定如何仅使用1个viewcontroller动态生成它。

Thoughts? 有什么想法吗?

Assuming all your filters look the same but have different data then you could just have one FilterViewController and change its data source depending on the filter type. 假设所有过滤器看起来都一样,但是数据不同,那么您可以只拥有一个FilterViewController并根据过滤器类型更改其数据源。

And yes, that does look like a simple UIPopoverController. 是的,这看起来确实像一个简单的UIPopoverController。

So when you have to display a new popover create a FilterViewController and assign it the appropriate data source. 因此,当您必须显示一个新的弹出窗口时,请创建一个FilterViewController并将其分配给适当的数据源。 You can use delegation to inform the parent class which filter was selected and use the data source to tell the filter view controller what data it should display to be filtered. 您可以使用委托来通知父类选择了哪个过滤器,并可以使用数据源告诉过滤器视图控制器应过滤哪些数据。

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

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