0
我使用下面的以編程方式創建NSPopupButton:NSPopUpButton文字重疊菜單圖像
...
NSPopUpButton *accessoryView = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 24) pullsDown:YES];
NSFont *aFont = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]];
[accessoryView setBezelStyle:NSRecessedBezelStyle];
[accessoryView setFont:aFont];
[accessoryView setShowsBorderOnlyWhileMouseInside:YES];
[accessoryView setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin];
NSArray *popupItems = [[NSArray alloc] initWithObjects:@"Your Account", @"Sign In", @"Create Account", nil];
[accessoryView addItemsWithTitles:popupItems];
...
現在,當我加入NSPopUpButton我的看法,我結束了按鈕的文本用於圖標重疊下拉式菜單。我以前在使用NSControl時看到過這種情況:setAlignment,但我沒有在這裏使用它。下面是輸出:
有人能看到我在做什麼錯?
保重,
傑里米