首页 > 其他 > 详细

给NSButton设置highlight image

时间:2015-12-16 18:51:00      阅读:428      评论:0      收藏:0      [点我收藏+]
@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

给NSButton设置highlight image

原文:http://www.cnblogs.com/Jackie88N/p/5051609.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!