我是使用 xcode 3.2.6
进行 iPhone
开发的新手,我想知道如何在导航栏中创建一个按钮,该按钮将显示一个下拉列表,其中包含我将编写一个列表来执行一些操作。如何做到这一点?
最佳答案
首先,您需要一个 UINavigationController
,它将为您提供 UINavigationbar
。在您的 .m
文件中,您可以设置一个按钮。
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(dropDown:)];
然后添加一个方法来处理触摸。
- (void) dropDown: (id) sender;
编辑
KSPopoverView TSPopover是一些开源 Popover。
关于iphone - 如何制作一个显示下拉菜单的按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10470004/