如何去除 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];
How to get rid of the black around my UIImage? (shown in link below)
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];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将视图的不透明值设置为 NO
这意味着视图不会填充其边界。
诺诺诺
try setting the opaque value of the view to NO
This means that the view isn't expected to fill its bounds.
nonono