简体   繁体   English

iPhone SDK中的弹出菜单?

[英]Pop-up Menu in iPhone SDK?

I'm designing a tab-based app, and I want a menu to pop up from one of the tabs when the user taps it. 我正在设计一个基于选项卡的应用程序,并且希望用户单击时从其中一个选项卡中弹出菜单。 Like in the WaveSense Diabetes Manager app (I would post pictures, but I'm a new user and SO won't allow it. It's a free download if you would like to check it out; it has a cool design that you can take some ideas from). 就像在WaveSense Diabetes Manager应用程序中一样(我会发布图片,但我是新用户,因此不允许这样做。如果要查看它,可以免费下载;它的设计很酷,可以拍摄一些想法)。

Tapping a tab bar icon brings up a little pop-up menu, as opposed to switching the UIViewController. 轻触标签栏图标会弹出一个弹出菜单,与切换UIViewController相反。 I've looked everywhere and have no idea how make something like this. 我到处都看过,不知道如何制作这样的东西。 I'm guessing modifications have to be made to the UITabBarController? 我猜必须对UITabBarController进行修改吗? Is the pop-up menu a custom UIView? 弹出菜单是自定义UIView吗? Please help! 请帮忙!

Thanks! 谢谢!

The tab bar delegate has a method tabBar:didSelectItem: . 标签栏委托具有方法tabBar:didSelectItem: You could render your menu at that time, animating it up from the tabBar if you wanted. 您可以在那时渲染菜单,如果需要,可以从tabBar对其进行动画处理。

As far as creating the menu, a UIView with a UITableView contained in it would work great. 至于创建菜单,包含UITableView的UIView会很好用。 You can make the view smaller than the width of the device screen if you like, to get the effect of it being a menu which slides up. 如果愿意,可以使视图小于设备屏幕的宽度,以使菜单向上滑动来获得效果。 It would also allow you to have more menu entries than would comfortably fit on the screen. 它还使您可以拥有比舒适地显示在屏幕上更多的菜单条目。

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

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