码迷,mamicode.com
首页 > 其他好文 > 详细

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

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

标签:style   io   os   ar   sp   cti   on   c   ad   

 

 

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的大小进行伸缩变换?

标签:style   io   os   ar   sp   cti   on   c   ad   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!