顶部的三角形看起来如此美妙,但我无法像这样组成。
我曾尝试编写如下代码,但我看到了一个普通的菜单。
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {// Insert code here to initialize your application
NSStatusItem * statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:110] retain];
[statusItem setTitle:@"Test"];
[statusItem setEnabled:YES];
[statusItem setHighlightMode:YES];
statusItem.menu = [[NSMenu alloc] initWithTitle:@"menu"];
NSMenuItem * menuItem = [[NSMenuItem alloc] initWithTitle:@"menuItem1" action:NULL keyEquivalent:@""];
[statusItem.menu addItem:menuItem]; }
请帮我做点什么来执行它。非常感谢!