如何摆脱我的UIImage周围的黑色?

时间:2011-03-12 15:30:16

标签: uiview uiimage

如何摆脱UIImage周围的黑色? (如下面的链接所示)

UIView *myView  = [[[UIView alloc] init] autorelease];
[myView setBackgroundColor:[UIColor clearColor]];
CCUIViewWrapper *wrapper = [CCUIViewWrapper wrapperForUIView:myView];

UIColor *background = [UIColor colorWithPatternImage:[UIImage imageNamed:@"alert_background.png"]]; 
myView.backgroundColor = background;

wrapper.contentSize = CGSizeMake(293,180);
wrapper.position = ccp(-90,190);
[wrapper setRotation:90.0];

[self addChild:wrapper];

http://img857.imageshack.us/i/screenshot20110312at153.png/

1 个答案:

答案 0 :(得分:0)

尝试将视图的不透明值设置为NO

myView.opaque = NO;

这意味着视图不会填满其边界。

NONONO