Iphone 以uiimage为背景的uiview

Iphone 以uiimage为背景的uiview,iphone,objective-c,Iphone,Objective C,u构建UIView并将图像作为视图背景: self.tmpView = [[UIView alloc] initWithFrame:CGRectMake(20, 70, 280, 295)]; self.tmpView.backgroundColor = [UIColor yellowColor]; self.tmpView.backgroundColor = [UIColor clearColor]; self.tmpView.backgroundColor = [UIColor col

u构建UIView并将图像作为视图背景:

self.tmpView = [[UIView alloc] initWithFrame:CGRectMake(20, 70, 280, 295)];  
self.tmpView.backgroundColor = [UIColor yellowColor];

self.tmpView.backgroundColor = [UIColor clearColor];
self.tmpView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"CloseUPPicBG.png"]]; 
问题是UIView现在的角点是黑色的。 我放在背面的图像是圆角的


有什么解决方案吗?

编辑图像,使其不具有圆角,或者使角落后面的空间是其他颜色或图像

你在说什么

View, be yellow.
View, be clear. What's behind you? Nothing. Ok, be black.
View, fill yourself with this image.
观点就是思想

Hmm... there's transparency in this image.
Guess I should show whatever's behind me. Which is nothing... So black. 

可能会有帮助。

如果视图是属性,则应自动删除该属性。非原子,保留。将实际图像资源更改为不具有圆角。
self.tmpView.opaque = NO;