IOS UIView 图片填充问题

UIImage *image = [UIImage imageNamed:@"name.png"];
//还有一种是这样的,感觉这样挺不错的 <span style="color:#990000;">UIImage *image = [UIImage imageWithContentsOfFile:path];</span>
view.layer.contents = (id)image.CGImage;
//如果需要背景透明加上下面这句
view.layer.backgroundColor = [UIColor clearColor].CGColor; 

posted @ 2015-01-13 14:27  赫凯  阅读(25)  评论(0)    收藏  举报