1

This is related to this question

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

I tried using a uitableviewcontroller instead of a pickerview as I couldn't understand how to use the picker view if I need it popping out (any info on it would be appreciated).

Now this is what I did.

I have a VC that calls out a "FilterVC". I only have one FilterVC that is called by 3 different "filter buttons", and I will just populate the VC depending on the button. The issue is, one button might have just 2 items that is needed to be shown, another one might containg up to 50. Was wondering how do I adjust the height of the popovercontroller that contains the uitableview? Also, is this the right way in dealing with popovers, 3 segues connected to one VC??? (It needed an anchor point)

Here's what it looks like

enter image description here

enter image description here

As a follow up question: Is this the right way to do it on an ipad? I feel like most people prefer the uipicker. The guy that answered my first question said it's more of a design thing. Now since I'm no designer, as a user, do you think uitableview is more appealing?

Thanks for your time!!

4

1 回答 1

2

在您在弹出窗口中显示的视图中,在self.contentSizeForViewInPopover您知道大小并在视图显示之前立即设置。

在选择器上使用表格视图的主要好处是它有一个滚动指示器,因此您可以看到选项列表的长度。同样显然,您可以准确控制列表的显示方式。因此,如果它适合您的 UI 样式,尤其是选项列表很长时,表格视图应该会更好。

于 2013-04-25T16:29:21.650 回答