iphone - 如何制作一个显示下拉菜单的按钮?

标签 iphone ios xcode menu drop-down-menu

我是使用 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/

相关文章:

ios - 我需要获取 API token 才能从 Jetpack API 获取 JSON 数据吗?

ios - 如何向iOS模拟器发送模拟远程通知?

iphone - Objective-C 在 iPhone 上测试应用程序,更新数据,数据没有改变

iphone - 没有为 APNS 获取设备的设备 token ?

iphone - https 连接是否自动使用 ssl 加密数据

ios - 如何暂停调用tableview的reloadData?

ios - xcode 构建失败,并从 : "_RCTSetLogFunction", o 引用 : -[AppTests testRendersWelcomeScreen] in AppTests.

ios - 使用约束将按钮移向目标,没有反应?

html - 如何为我的网站提供适用于 iPhone 的图标?

iphone - 如何唤醒应用程序