首页 > 其他 > 详细

手写NSButton设置的背景图片为什么不会随着Button的大小进行伸缩变换?

时间:2014-09-12 16:41:23      阅读:225      评论:0      收藏:0      [点我收藏+]

 

 

NSButton *tempBtn = [[NSButton alloc] initWithFrame: NSMakeRect(200, 200, 20, 20)]; 
[tempBtn setButtonType: NSMomentaryPushInButton]; 
[tempBtn setBezelStyle: NSRoundedBezelStyle]; 
[tempBtn setBordered: NO]; 
[tempBtn setImage: [NSImage imageNamed: @"Test"]]; 
[tempBtn setImagePosition: NSImageOnly]; 
[tempBtn setTarget: self]; 
[tempBtn setAction: @selector(clickBtn:)]; 
[self.window.contentView addSubview: tempBtn]; 
[tempBtn release];

 

 

[[tmpButton cell] setImageScaling:NSImageScaleAxesIndependently];

手写NSButton设置的背景图片为什么不会随着Button的大小进行伸缩变换?

原文:http://www.cnblogs.com/spiderdzl/p/3968527.html

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