단추 스타일 설정에 문제가 있습니다. Apple 문서를 이미 읽었지만 스타일을 올바르게 변경하는 방법을 여전히 모릅니다. "NSButton 사용자 지정 스타일 프로그래밍 방식으로 <OSX/Objective-C>
[loginBtn.layer setBackgroundColor:[NSColor colorWithCalibratedRed:35/255.0f green:216/255.0f blue:202/255.0f alpha:1.0f]CGColor];
내가 제대로 목표 - C에서와의 backgroundColor를 설정하는 방법 : 여기
내 코드입니다 :NSButton *loginBtn = [[NSButton alloc] initWithFrame:NSMakeRect(screenWidth/2 - 155, screenHeight/2 - 115, 300, 30)];
[loginBtn setCell:defaultButton];
[loginBtn setWantsLayer:YES];
[loginBtn setButtonType:NSButtonTypeMomentaryPushIn];
NSMutableAttributedString *buttonString = [[NSMutableAttributedString alloc] initWithString:@"Login" attributes:btnTextDictionary];
[loginBtn setAttributedTitle:buttonString];
[loginBtn setTarget:self];
[loginBtn setAction:@selector(loginActive)];
[loginView addSubview:loginBtn];
나는 RGB로 배경색을 변경하려고하지만, 작동하지 않는 OSX 응용 프로그램 프로젝트 "?
NSButton이없는 'backgroundColor'속성. – norders