@property (strong) NSButton *shuffleButton; self.shuffleButton = [[NSButton alloc] initWithFrame:CGRectMake(0, 0, 25, 14)]; self.shuffleButton.bordered = NO; [self.shuffleButton setButtonType:NSMomentaryChangeButton]; [self.shuffleButton setBezelStyle:NSDisclosureBezelStyle]; [self.shuffleButton setImagePosition:NSImageOnly]; [self.shuffleButton setImage:[NSImage imageNamed:@"shuffle"]]; [self.shuffleButton setAlternateImage:[NSImage imageNamed:@"shuffle_highlight"]]; [self.shuffleButton setTarget:self]; [self.shuffleButton setAction:@selector(shuffleButtonAction:)];
shuffle 是normal状态下的image
shuffle_highlight 是按下状态的image
时间: 2024-10-21 19:23:39